How to Change Lock and Login Screen Wallpaper in elementary OS


This tutorial explains the steps you need to change the lock and login screen background in elementary OS. This will replace the default grey background.

Changing the lock or login screen background grey default wallpaper in elementary OS is a bit difficult. The typical greeter configuration change with the path of the image file would not work.

Unfortunately, it’s not an easier solution because the grey background is an image file and its data is hardcoded in the greeter and need to be recompiled with a new image to make it work.

Here’s how.

Lock / Login screen background elementary OS (Odin)

Change Lock and Login Screen Background – elementary OS

WARNING: Whenever there is a release of a new version of Greeter/updates to Greeter, the following changes would be overwritten by the system. Hence you need to do these steps again. And these changes may need a little bit of source code compilation experience. That means, you understand what each of these commands does and know how to fix it.

  • Open a terminal in your elementary OS.
  • Install git and following dependencies for greeter package.
sudo apt install git
sudo apt install -y gnome-settings-daemon libaccountsservice-dev libgdk-pixbuf2.0-dev libgranite-dev libgtk-3-dev libhandy-1-dev liblightdm-gobject-1-dev libmutter-6-dev libwingpanel-dev libx11-dev meson valac
  • Go to temporary /tmp directory and clone the latest greeter master branch from GitHub.
cd /tmp
git clone https://github.com/elementary/greeter.git
  • After cloning is complete, open the path /tmp/greeter/data in a file manager.
  • The elementary OS uses a PNG file of 100×100 px as default background in the login screen/lock screen. The image is tiled, and it gives an impression of grey background.
  • Rename your desired wallpaper image with texture.png and overwrite the following file in the path.
gray background is created using this file
 /tmp/greeter/data/texture.png
  • Open the file /tmp/greeter/compositor/SystemBackground.vala in a text editor and replace the following line –
change the path of image
resource:///io/elementary/desktop/gala/texture.png

With –

resource:///io/elementary/greeter/texture.png
  • Save the file.
  • Open the terminal again and build greeter using the following commands.
cd /tmp/greeter
meson _build --prefix=/usr
sudo ninja install -C _build
building greeter
  • If you face any build error, let me know in the comment below. You should not be seeing any error, as I have tested it.

After the above commands are complete, you can test the login screen by running lightdm in test mode –

lightdm --test-mode --debug

If it looks good, reboot the system. And you should be seeing your wallpaper on the login screen in elementary OS.

This guide should work in elementary OS 6 Odin, elementary OS 5 Juno and below.

Closing Notes

I hope this guide helps you to change the background of the lock or login screen in your elementary OS. Honestly, it’s 2022 and changing a background image of the login screen requires a compilation of code surprises me.

If you run into any errors, let me know in the comment box below.