Update-alternatives in Debian Wheezy – changing the logon wallpaper the right way

Debian Wheezy has a system for keeping one setting sycnronized for multiple applications. It is called the Debian Alternatives System. Is was designed to enable the OS to automatically choose a program where multiple alternatives are available but it also handles artwork like the logon wallpaper.

So I wanted to change the wallpaper for my Lightdm and my personal desktop in Xfce4 to the same picture. I did that using update-alternatives.

Wallpaper set with update-alternatives I downloaded the wallpaper from Wallxite.com; it has the imaginative name of 'fiction-wallpapers-0013'.
Wallpaper set with update-alternatives
I downloaded the wallpaper from Wallxite.com; it has the imaginative name of ‘fiction-wallpapers-0013’.

Wallpapers are stored in /usr/share/images/desktop-base. I downloaded mywallpaper.jpg and copied it to the wallpaper directory:

# cp /home/vorkbaard/mywallpaper.jpg /usr/share/images/desktop-base/

Make it readable for anyone:

chmod 644 /usr/share/images/desktop-base/mywallpaper.jpg

Then I tried to set it as wallpaper with update-alternatives:

update-alternatives --config desktop-background

Update-alternatives showed me all the files in the desktop-base directory except my newly downloaded wallpaper! So I tried to set the file manually:

update-alternatives --set desktop-background /usr/share/images/desktop-base/mywallpaper.jpg 65

(65 being the priority – not really relevant here but Debian needs one. Any numeric value will do.)

Now update-alternatives said my file was not registered. Ok, to register the picture:

update-alternatives --install /usr/share/images/desktop-base/desktop-background desktop-background /usr/share/images/desktop-base/mywallpaper.jpg 65

See if my picture is available for –config:

update-alternatives --display desktop-background

That listed all available (registered) wallpapers, including mine. I set it with

update-alternatives --config desktop-background

…and choosing my wallpaper. The –set option would most probably also have worked now.

Rebooting showed the wallpaper in my profile was alright now but not yet on the logon page. Since I use Lightdm I edited /etc/lightdm/lightdm-gtk-greeter.conf thusly:

background=/usr/share/images/desktop-base/desktop-background

Back to Top