Set a wallpaper from command line in Gnome 3 (Unity, Gnome Shell)
Under Gnome you could set the wallpaper from command line with the following commands:
gconftool-2 --type=string --set /desktop/gnome/background/picture_filename /path/to/image.jpg gconftool-2 --type=string --set /desktop/gnome/background/picture_options stretched # stretch the image
You try it again on a newer Ubuntu that uses Unity, and nothing happens! What’s going on?
The new way of setting a wallpaper is this:
gsettings set org.gnome.desktop.background picture-uri file:///path/to/img.jpg
Notice that you must provide a URI, hence the “
The first snippet works with Gnome 2. The second one is for Gnome 3. To figure out your Gnome version, launch the command “