Linux wallpaper change

I’m trying to change the wallpaper on linux ubuntu machines and am trying to get this code to work.
any ideas why it is failing?

wait su {name of current user} -c "(gsettings get org.gnome.desktop.background picture-uri ‘file:///usr/share/backgrounds/Desktop.jpg’)"
wait su {name of current user} -c “(gsettings set org.gnome.desktop.background picture-uri ‘file:///usr/share/backgrounds/Desktop.jpg’)”

its not the single quotes as I have removed them and it still fails, it must be the forward slashes.

Any help would be greatly appreciated.
Thank you in advance

Using ‘su’ in that way is unlikely to source the users dot-files or use the “normal” $PATH variable set by shell scripts…you may need to supply the full path to the ‘gsettings’ binary

thank you I will give it a try.

I finally got it working, had to use {name of logged on user} :-):laughing:

wait chmod a+rwx "/usr/share/backgrounds/Desktop.jpg"
override wait
completion=job
wait su {name of logged on user} -c "(cd {parameter “baseFolder”})"
wait su {name of logged on user} -c “(gsettings set org.gnome.desktop.background picture-uri ‘file:///usr/share/backgrounds/Desktop.jpg’)”

2 Likes