I have a script that updates my desktop background every day with the NASA APOD. Since upgrading to 11.10, that script stopped working, presumably because I'm using
gconftool-2 to actually update the desktop background. Is there a new way to do this under Unity?
Both Unity and Gnome Shell (Gnome 3) use GSettings now instead of GConf. So in Unity and Gnome Shell you can use the command-line tool
You can get the current URI of the background image as follows:
And set the background URI as follows (which will immediately update your desktop background):
Notice that you must prepend the URI with "file://" for this to work (unlike with
In order to make your script work with both Gnome 2 and Shell/Unity, you can let it do a Gnome version check first:
That will return the version of Gnome. If the version number starts with 3, then
This code randomly changes the wallpaper from a given directory.
Save this script and edit your with the command "crontab -e" (it launches an editor where you put this line at the end of the file):