I’m not saying the expansive block of aubergine that greets me on the Ubuntu login screen is bad, but it’s not really me.

Until now I’ve not bothered to look into how to change the GDM background because —as I’m sure many of you are about to point out— I see it for about 3 seconds tops (6 maybe, if I make a typo in my password which, yes, is often).

Or to put it another way: Ubuntu’s login screen is not something most of us see long enough to care enough about.

And yet this evening curiosity got the better of me. I looked into how to change the Ubuntu login screen background and to my surprise I learned it’s …not that easy to do!

Back in the days of LightDM (Ubuntu’s old login manager) we could change the login background image in a couple clicks. GDM is a tougher nut to crack; GNOME devs really want us to see anything but a solid colour in the greeter!

Today, you can change Ubuntu’s login screen background but you’ll need to roll up your sleeves to do so. And if you’re currently sleeveless? Put a shirt on you weirdo, then come join me!

Change Ubuntu’s Login Screen Background

a screenshot of the ubuntu login screen as default

My aim is to change the solid block of purple above in to something more related to my actual Ubuntu desktop, which is this:

a screenshot of my ubuntu 21.10 desktop
My current desktop set-up is very pink/purple

Ideally, I want something that looks as schmexy as the GNOME Lock Screen with its frosted blur allure:

a screenshot of the ubuntu lock screen
GNOME’s Lock Screen has a nice blurred effect by default

Mmm!

To get going I’m using a script created by a GitHub user called PRATAP.

Now, I know: using a random script from the backend of the interweb fondling sensitive parts of your system is a Not Very Clever™ thing to do dot inc. Be smart and give the script a look over BEFORE you run it (I did, but I can’t guarantee the script won’t change between the time I looked at it and the time you use it).

You can download the GDM background changer script using wget from a terminal:

wget https://github.com/PRATAP-KUMAR/ubuntu-gdm-set-background/archive/main.tar.gz

Once fully download just extract/unpack the .tar.gz — Tarbell? Tarball? I can never remember — using your file manager or an archive utility of your choice.

Inside the extracted folder you’ll find another folder, and inside that folde res the script we need plus a comprehensive README file that talks us through all of the script’s various options:

README files mean it, folks

I think I’ll start by making Ubuntu’s login screen background use the same .png image that I use for my desktop wallpaper.

If you only want to change the login screen colour, or apply a favourite gradient, the included README file runs through those options.

Since I know the path to my background wallpaper it’s just a case of switching back to the terminal and using cd to enter the downloaded script directory in a terminal. Then I run the script (with sudo, eek) passing it the path to the image I want to use as a background

cd ~/main/ubuntu-gdm-set-background-main
sudo ./ubuntu-gdm-set-background --image ~/Downloads/mywallpaper.jpg

A few blinks and one reboot later I’m looking at this:

a screenshot of the ubuntu login screen (GDM) using a custom image
This is okay, but not what I want

Nice — but it’s not exactly what I want. The wallpaper looks very sharp in focus like this. Were it a tad busier it would make it hard to ‘see’ the login pod (which is probably why the login screen uses a plain colour by default).

I want something more akin to the blurred effect the lock screen uses. The quickest way to achieve that is to fork GDM and patch in some custom blur code I found on the inside of an abandon—Just kidding: I’ll open the image in an image editor (like The GIMP) and apply a Gaussian blur filter effect, save it, and then set that image as the login screen background.

It took me roughly five minutes to settle on a blur level I felt looked good. I think exported the image and applied it using this script:

sudo ./ubuntu-gdm-set-background --image ~/Downloads/mytweakedwallpaper.jpg

Next I hit ctrl + alt + f1 to see how it looks in situ:

a screenshot of the ubuntu login screen (GDM) using another custom image
Oh yes, this is what I wanted

Oh yes — this, my compadres, is precisely what I set out to achieve.

Awesome stuff!

Setting a gradient not an image

So, I’m curious how good this script’s gradient support I’m going to try and apply the “disco” gradient from the header of omg! ubuntu! as the login screen background.

But there’s a small problem: the gradient we use on omg! composed of three colour stops but the README for this script only shows an example that uses two colour stops.

Will three work? Let’s see…

a screenshot of the ubuntu login screen (GDM) using a custom gradient
Pretty nice, all said!

At first glance you might think it worked. This is indeed a gradient going from purple to orange.

However: I’m pedantic about my own site’s branding and I know that this gradient is not the one I tried to apply. The script only used the first two hex values I passed in command, not all three.

Which is a bit of a bummer as the proper gradient would’ve looked cool.

There are other gradient limitations in this script, like the fact you’re limited to only horizontal or vertical gradients, i.e. linear, so you can’t use alternative angles or a radial gradient (which would look especially good on Ubuntu’s login screen given the centralised placement of the login pod).

For me, I’m going back to the blurred purple look instead.

If you find you can’t create the gradient you’d like using this script then there’s a work around: creating it in an image editor like The GIMP at your screen’s resolution, export the image, then set it as your login screen background.

Undoing the changes is easy, btw

I’ll end this (phenylephrine-fuelled) post on an undo; I’ll reset the Ubuntu GDM login screen back to its default colour. This is super easy because the script I’ve been using has a --reset option that. When run this does what you’d hope it does.

sudo ./ubuntu-gdm-set-background --reset

So that’s it. You’ve seen how (relatively) easy it is to change the Ubuntu login screen background, be it. by setting your own login screen background image or applying a different colour of gradient. Plus, it’s really easy to undo should you get bored of staring at your custom creations!

h/t Scott