I would like to set the wallpaper in the login screen (Unity Greeter), how do I do that?

16 Answers 16

up vote 77 down vote accepted
+200

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.

  • I think, adding this information will help future users like us, who want to disable any paper on lightdm. I first disabled the "drawing-user-background" feature and then sat a background which only exists in .. (no it doesn't exists). I have now a nicer login screen. – Anwar Jul 30 '12 at 14:08
  • I used "Changing the default fixed background" and it works, but then I don't know why, I get a message with "low-graphics mode" after reboot and lightdm doesn't start anymore. Then I found this solution to change the lightdm background. – BuZZ-dEE Sep 7 '12 at 16:17
  • I have two users, each with different (custom) wallpapers. I want one user to display his own wallpapaer on the login screen, but I want the other one to display the default warty-final-ubuntu one. How would I do this? Is it even possible, without an extra program, to set login backgrounds on a per-user basis other than the user's wallpaper? – JamesTheAwesomeDude Jan 15 '13 at 21:27
  • How is it possible to change the warty-final-ubuntu.png that is shown when ubiquity installer is displayed to some other images ? – Roshan George Jun 22 '13 at 1:30
  • 1
    What about 16.04? – Karl Morrison Nov 1 '16 at 16:38

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

  • 1
    The first time I tried this I used a file in /home and it didn't work, I just had a black background (Maybe because /home is encrypted?). Changing it to a file in /usr/share/backgrounds/<name-of_picture>.jpg worked though. – Tom Brossman Oct 17 '11 at 8:04

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/

  • 3
    This seems to be the best way to do it in 12.04. – Carsten Agger Oct 21 '13 at 8:43
  • 1
    i was able to use this for our preseed environment with Ubuntu 13.10! – Bastian Rang Jan 31 '14 at 12:52
  • 1
    This approach is listed on the Ubuntu Wiki, lightdm page, has been mentioned on various forums, including Arch ones. I've taken the liberty to create a small script that allows changing the greeter at will through command line, in form of sudo ./script /path/to/image . It can be found on my github page. It has been tested in Ubuntu 14.04 LTS and 15.10. – Sergiy Kolodyazhnyy Nov 18 '15 at 4:51
  • The answer works in 16.04 as well. – WinEunuuchs2Unix Dec 5 '16 at 23:18

11.10 - Simple LightDM Manager

An enterprising developer has put together a simple applet that will change the wallpaper:

enter image description here

to install

sudo apt-add-repository ppa:claudiocn/slm
sudo apt-get update
sudo apt-get install simple-lightdm-manager

source

  • Connection to this repository is flaky – enthusiasticgeek Apr 22 '14 at 21:56

11.10

I'd suggest to use Ubuntu Tweak. You can configure what the logo and the backgroundimage comforably without messing around with config files:

enter image description here

This screenshot was taken on 10.10 Maverick, if somebody can check easily if it works also with recent Ubuntu versions an edit of this answer is welcome!

  • 1
    The UI is quite different, but it does allow the user to change both the background and the login screen logo. – Alfredo Hernández Mar 26 '12 at 18:20
  • @AlfredoHernández in 11.10 I suppose? – lumbric Mar 26 '12 at 20:40
  • Yes, sorry, I forgot that part xD – Alfredo Hernández Mar 26 '12 at 20:45
  • It messed my login wallpaper! Now it has black background! – Ravi Apr 17 '12 at 6:40

Ubuntu 12.10

This approach uses the dconf-editor, rather than gsettings. Changes to the unity-greeter must be done as the lightdm user. The steps are as follows:

  1. Change to root user.
  2. Give lightdm user access to the X server.
  3. Change to lightdm user.
  4. Run dconf-editor.
  5. Select /com/canonical/unity-greeter and change properties.

  1. Change to root user.

    sudo -i
    
  2. Give lightdm user access to the X server.

    xhost +SI:localuser:lightdm
    
  3. Change to lightdm user.

    su lightdm -s /bin/bash
    
  4. Run dconf-editor.

    dconf-editor
    
  5. Select /com/canonical/unity-greeter and change properties.

    dconf-editor

  • dbus-launch dconf-editor is required(?). – Khurshid Alam Mar 25 '13 at 13:21
  • dconf-editor is required. Use sudo apt-get install dconf-editor. I've used this on 12.04, 14.04 and 16.04 – tlhIngan Oct 20 at 19:57

For 11.10:

You need to edit /etc/lightdm/unity-greeter.conf (sudo nano /etc/lightdm/unity-greeter.conf). In that file you have to replace value of BACKGROUND tag.

For ref check the below screen shot.

enter image description here

The main answer doesn't work for me, as I'm not using unity-greeter. My lightdm is configured to use lightdm-gtk-greeter.

I found a solution by looking through the lightdm source code. It queries DBus to find the BackgroundFile property for the user. You can change this by using the d-feet program (or command-line tools).

Navigate to this point on d-feet:

http://i.stack.imgur.com/PvvMe.png

Double click the "SetBackgroundFile" function. In the window that opens, type your desired wallpaper filename (with double quotes around it). Click the Execute button. If all is well, you'll see a message like, "This function didn't return anything".

The next time lightdm runs, it should have the new wallpaper that you selected.

  • Also of note is that I'm not using any of the main window managers (I'm using i3), which is why I can't use other methods. – Jeremy Stephens Aug 14 '13 at 16:04
  • Here's a script you can use to set the wallpaper from the command-line: gist.github.com/viking/6232740 – Jeremy Stephens Aug 14 '13 at 16:23

All versions

1) Download Ubuntu Tweak:

Download for Ubuntu 12.04 Precise Pangolin

Download for Ubuntu 11.10 Oneiric Ocelot

Download for other Ubuntu

If you use 12.04 Precise: to change the login wallpaper just change your desktop wallpaper, with Ubuntu Tweak you can change only the logo.

If you use 11.10 Oneiric you can use Ubuntu Tweak to change the login wallpaper and logo.

2) Open the downloaded package and install it screenshoot

3) Launch Ubuntu Tweak.

Go to Tweaks > Login Settings. Click Unlock and click on the image you want to change. screenshoot

If you use 12.04 Precise: to change the login wallpaper just change your desktop wallpaper, with Ubuntu Tweak you can change the logo.

This is a workaround for 12.04 and the current version of unity-greeter (the default "theme"). For other greeters like lightdm-gtk-greeter, the usual editing of the conf file in /etc/lightdm/ works. But unity-greeter no longer looks at unity-greeter.conf, and it's unclear how to configure it.

What I did is this: I found the image that unity-greeter insists on using. For me, it was in /usr/share/backgrounds. Move/delete/rename it. Now unity-greeter will fallback to the default background which is /usr/share/backgrounds/warty-final-ubuntu.png. Move/delete/rename that. Now you need to put another image at that location with that name. And no, it doesn't have to be a png (in fact, warty-final-ubuntu.png is actually a jpg for reasons I won't go into here). I believe the replacement must be a jpg (someone correct me if I'm wrong). Be very careful here. I think if lightdm can't fallback to the default background, something horrible might happen :-/ (maybe it'll only show a colored background... anyway be careful!).

In my case, I just made a symlink from another background in that location:

sudo ln -s Bird_by_Magnus.jpg warty-final-ubuntu.png

run this command while you are in /usr/share/backgrounds/ (or adjust command accordingly). Of course, replace the jpg with whatever is available and desired.

Keep in mind that if you are going to use a background in your home, you need to make sure your home is not encrypted, as lightdm will not be able to read that file until you login. Also make sure you have the right permissions on the file. If you don't know what any of this means, stick with a wallpaper that's already in /usr/share/backgrounds/. (Random tip: you can get more wallpapers from earlier versions of Ubuntu installed properly in that directory by sudo apt-get install ubuntu-wallpapers-oneiric, replace 'oneiric' with 'natty', etc.)

  • Jokerdino found the right answer. This one should be deleted now. – Chan-Ho Suh Apr 14 '12 at 2:27
  • At the risk of looking narcissistic, I just found my own answer very useful once again, so I undeleted it. :-/ – Chan-Ho Suh May 22 '13 at 22:51

This what worked for me. Via nautilus, I renamed the original /usr/share/backgrounds/warty-final-ubuntu.png image file inside , then I pasted my preferred image as the login wallpaper and renamed it to warty-final-ubuntu.png, then applied the same file properties as with the original one.

Ubuntu 16.10 without X11 using dconf

This solution is a variant of the one by samb. Benefits of this solution are that all customization is done in /etc and that only one file has to be compiled.

mkdir /etc/dconf/db/local.d
sudo edit /etc/dconf/db/local.d/10-unity-greeter

Change the settings to your preference:

[com/canonical/unity-greeter]
draw-user-backgrounds=false
background='/usr/share/backgrounds/Haukland_Beach_view_by_Michele_Agostini.jpg'

Create the compiled file for these settings:

sudo dconf compile /etc/dconf/db/local /etc/dconf/db/local.d

Edit the user profile:

sudo edit /etc/dconf/profile/user

Include the local customization via a system-db entry:

user-db:user
system-db:local

You might need to restart lightdm to make your changes show:

if dialog --defaultno --yesno "Restart lightdm?\n\nThis will terminate all desktop sessions!" 10 30; then sudo service lightdm restart; fi

Et voilà, a customized unity-greeter background.

The result

12.04

In Ubuntu 12.04 you don't need to do all those command line edits anymore. All you have to do is change your wallpaper and voilá, LightDM will use it as the background (:

Sadly it seems not fully implemented yet, since when your computer starts, you see the default Ubuntu wallpaper for some seconds before it change to your wallpaper. But since we are talking about a beta (Ubuntu 12.04 is in Beta 2 right now), it's expected.

Hope it answered your question (:

  • 1
    I don't think this works unless you use Unity and change your wallpaper in Unity. In any case, what you're suggesting doesn't work if you want a different wallpaper in lightdm from what you have in your desktop environment. – Chan-Ho Suh Apr 13 '12 at 1:35
  • @Chan-Ho Suh True, but since he did not specified that he was using another interface, i assume he is using Unity. About the second point, true (: – Julian Fernandes Apr 13 '12 at 5:26
  • This is the only way to change the wallpaper at the moment. – Gary Apr 14 '12 at 0:47

Ubuntu 12.04

Just put the desired lightdm background in the default Ubuntu pictures folder (not a subfolder) and then set it as your wallpaper.

Source: http://wiki.ubuntuusers.de/LightDM#Hintergrundbild

Ubuntu 16.04

After using Nautilus to navigate and view an appropriate .png or .jpg file to use as login screen and lock screen wallpaper, Nautilus can set this for you using a script:

Set Login Wallpaper.gif

Note: In Ubuntu 18.04 only the lock screen wallpaper is changed. A different technique will be required to change the login wallpaper.

To create the script use:

cd ~/.local/share/nautilus/scripts/
gedit set-login-wallpaper

Paste in these lines:

#!/bin/bash

## Set login wallpaper

# strip new line char passed by Nautilus
FILENAME=$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed -e 's/\r//g')

# Multiple files can't be selected.
LINE_COUNT=$(wc -l <<< "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS")
LINE_COUNT=$((LINE_COUNT-1))

if [[ $LINE_COUNT > 1 ]] ; then
    zenity --error --text "Ony one file can be selected at a time! "
    exit 1
fi

# Object type must be "file..." (ie no directories, etc.)
if [ -d "${FILENAME}" ] ; then
    zenity --error --text "$FILENAME is a directory!";
    exit 1
else
    if [ -f "${FILENAME}" ]; then
        : # Bash noop
    else
        zenity --error --text "${FILENAME} is not a file!";
        exit 2
    fi
fi

# Build working file in /tmp
echo "[com.canonical.unity-greeter]" > /tmp/set-login-wallpaper.tmp
echo "draw-user-backgrounds=false" >> /tmp/set-login-wallpaper.tmp
echo "background='$FILENAME'" >> /tmp/set-login-wallpaper.tmp

# Must run as sudo
if [ "$EUID" -ne 0 ] ; then

    # Get sudo password
    PASSWORD=$(zenity --password --title="Set Login Wallpaper" --timeout=20)

    # copy working file to real file using sudo
    echo $PASSWORD | sudo -S cp /tmp/set-login-wallpaper.tmp \
/usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override

    # compile using sudo
    echo $PASSWORD | sudo -S glib-compile-schemas /usr/share/glib-2.0/schemas

else
    # Already sudo so simply copy and compile
    # copy working file to real file
    cp /tmp/set-login-wallpaper.tmp \
/usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override

    # compile
    glib-compile-schemas /usr/share/glib-2.0/schemas
fi

exit 0

Save the file and exit the gedit editor.

Now mark the script as executable using:

chmod +x set-login-wallpaper

Open Nautilus and navigate to your directory with wallpaper images. Find an appropriate image and right-click on it. This drop-down menu appears:

Nautilus Right Click Drop Down

Click on the third option Scripts. Another drop down menu appears with all your scripts:

Nautilus set-login-wallpaper Drop Down

Select set-login-wallpaper.

When the script runs you will have to enter your sudo password.

Reboot and enjoy your new login wallpaper.

12.04

This is my solution to those who are not able to change the login screen background.

I was having this problem when I changed the wallpaper but I was getting the default Ubuntu login background. So what I did was locate the wallpaper.jpg file in terminal and change its permissions to, say:

chmod 777 walpaper.jpg

Something which gives full access and now we can see the effect. The wallpaper I choose on desktop is also seen as the login screen background. This applies for all users.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.