Why Change the Login Screen?

You may have noticed that the latest versions of Ubuntu, such as Ubuntu 18.04 and 20.04, like all previous versions, have a very simple-looking login screen. Whether you like it or not, you’ll notice this purple screen every time you log in or lock and unlock your system. If, like me, you’re the kind of person who likes to customize desktop backgrounds and wallpapers and lock screens to create a little more eye candy, you’d certainly want to improve this seemingly simple-looking site.

Although changing backgrounds and locking screens is very easy in the latest version of Ubuntu, changing the login screen is the only real thing. Even if you change the lock screen via the user interface, the purple face of the login screen remains intact.

Ubuntu Lock screen

In this tutorial, we will demonstrate how to change the login and lock screens to something more friendly. All we need to do is edit the ubuntu.css file which is responsible for controlling the layout for the login page, among other things. We are running this tutorial on an Ubuntu 18.04 system. All you need to run this tutorial is a new .png file that you will be using as your new background. Please download this file if it is already not present in your system.

How to Change the Ubuntu Login screen

In order to change your login screen, follow these steps:

The first thing we need to do is modify the ubuntu.css file located under /usr/share/gnome-shell/theme. Open the Terminal application through Ubuntu Dash or by pressing Ctrl+Alt+T

Enter the following command to open the css file in gedit.

$ sudo gedit /usr/share/gnome-shell/theme/ubuntu.css

Alternatively, you can use your favorite text editor to open this file. The file will open as follows through the gedit command:

Open ubuntu.css file

Search for the term ‘lockDialog’ by pressing Ctrl+D and entering this keyword in the search bar. This way you will be directed to the location where we want to make the required changes. This is the section of the file we will be editing: lockDialogGroup

You can see that the file noise-texture.png specifies the default image that Ubuntu uses as the lock and login screen background.

You need to replace the above-mentioned lines with the following ones:

#lockDialogGroup {
background: #2c001e url(file:///[fileLocation/filename.png]);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}

Replace the [fileLocation/filename.png] part with the location and filename of the image you want to use as the new background.

You can see how our CSS file looks after we have made the changes:

Updated css

Save this file by clicking the Save button located at the top right corner of the text editor.

Restart your computer for these changes to take effect.

Now when you log in to your system, you will be able to see the newly set up background instead of the default Ubuntu login image. Our new login and lock screen looks like this after the changes we made through this tutorial:

Customized Ubuntu Lock Screen

So, as you have seen, changing the login background is not as difficult as it seems. You simply need to edit the ubuntu.css file and restart the computer in order to make this supposedly technical customization.

How to Change Login/Lock screen background in Ubuntu
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn