Sunday 23 June 2013

Gnome3 login screen background

Using the default background for the login screen has never really bothered me, however I thought it would be useful to know how to customise it.

Changing the desktop background is easy in the graphical environment using gnome-control-center.

However the background for the login screen is set for the user that runs the login screen, which is gdm. Therefore changes need to be made for the gdm user. I have found mentions of modifying xml files directly but it looks like the easiest way is to launch the gnome-control-center as the gdm user.
The steps are

su -
xhost +si:localuser:gdm #to allow gdm user access to X server session
sudo -u gdm dbus-launch gnome-control-center

The desktop background picture can now be changed to either one of the defaults or a new custom picture if desired. Once picture has been selected and gnome-control-center has been closed the change will take effect.

The only thing left is to remove access for gdm user to X server session
xhost -si:localuser:gdm

To change the desktop background from the commandline you can use the gsettings command and point it at you picture file as follows
gsettings set org.gnome.desktop.background picture-uri "file://<filename>"