How do I change the wallpaper of the login screen?

Ubuntu 12.04 to 13.04

Ubuntu 12.04 Unity greeter has introduced selected user dynamic background, that means that when selecting a user from the available users list the background will change to reflect the selected user's desktop background.

By default lightdm will set /usr/share/backgrounds/warty-final-ubuntu.png as the default background and the option for the dynamic background switching on.

Setting the dynamic switching off


Open a terminal and get root

sudo -i

(Type sudo password)

Allow the user lightdm to create a connection to the X server

xhost +SI:localuser:lightdm

Switch user to lightdm

su lightdm -s /bin/bash

Turn off the dynamic switching of the background

gsettings set com.canonical.unity-greeter draw-user-backgrounds 'false'

If you want to reset that setting to default after changing it, follow all the steps until the command above and instead use

gsettings reset com.canonical.unity-greeter draw-user-backgrounds

When you are done setting off or reseting to default the dynamic background feature you can close the terminal or type 2x exit, first to revert back to root and the second to clear the root privileges and revert back to your normal user.

Changing the default fixed background

(you will only see this one if the user did not set a desktop background picture or if the dynamic setting is set to false)

Open a terminal and get root

sudo -i

(Type sudo password)

Allow the user lightdm to create a connection to the X server

xhost +SI:localuser:lightdm

Switch user to lightdm

su lightdm -s /bin/bash

Change the default background with a picture of your choice

gsettings set com.canonical.unity-greeter background '/foo/wallpaper.png'

(Note: the wallpaper file cannot be located inside a encrypted user's home, those are only mounted after the user has logged in with his account.)

If you want to revert that to the default background follow all the steps until the command above but instead type

gsettings reset com.canonical.unity-greeter background

When you are done changing the default background feature or reverting back to the default one you can close the terminal or type 2x exit, first to revert back to root and the second to clear the root privileges and revert back to your normal user.


For 11.10

Run this command in the terminal (Ctrl+Alt+T)

gksu gedit /etc/lightdm/unity-greeter.conf

You will see gedit (text-editor app) appear with this text:

enter image description here

Just edit the line that says BACKGROUND=... with the absolute path to the background image of your desire.

Then click save or Ctrl+S and close the window. You are done.

Log out to see it working.

source


Ubuntu 12.04, 14.04 & 16.04

Bruno Pereira's answer worked for me but could not be used in a context without X11. Here is an other way to do the same ... without the need of X11 (and easily scriptable) :

Edit the following file :

sudoedit /usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override

[com.canonical.unity-greeter]
draw-user-backgrounds=false
background='/foo/wallpaper.png'

Apply the new settings :

sudo glib-compile-schemas /usr/share/glib-2.0/schemas/