How to change the gdm3 login background?

I want to change the background in login screen which currently a annoying purple colour. I checked many forums but none of them told how to do it on Ubuntu not for budgie. I have Ubuntu Budgie version:

Budgie 10.5.1

The background of the login window can be changed relatively easily. Just go to Budgie Menu > Login Window (in German: Anmeldefenster). You must enter your password before you can make any changes. Select the desired background, the desired GTK theme, etc. in the window of the first tab. Then just close the window. That’s it.

Already tried that… It didn’t work

If you’re talking about changing the Wallpaper? Then its just a right mouse-click (same as in Windows). I see you’re using another version of Budgie so this might not apply. I’m on 20.04 LTS.

Ubuntu Budgie uses slick-greeter which is a lightdm based greeter.

If you have changed this to GDM3 then I’m guessing this might be the solution https://ostechnix.com/how-to-change-gdm-login-screen-background-in-ubuntu/

Well I have tried that and the problem is I don’t have the file called:

/usr/share/gnome-shell/theme/ubuntu.css

Instead I have:

/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource

and the .gresource file is not interested in getting edited…

.gresource files are a real pain to play with. You need to decompress it first. Then edit what you gotta edit, then edit the xml file and finally compress it back.

It sounds like it is going to be a pain but I really hate that purple login screen and ready to spend even an hour to change it… How do I decompress it???

I’ve done that a while ago and I don’t remember exactly how I managed.

It involves glib-compile-resources and gresource extract, so you should look into these.

It’s going to require a bit of edit and tinkering to manage the initial extraction of files (I had a hard time getting the path right for extraction to work). And to create the new xml to rebuild.

When you’ve done it once and it works though, it becomes routine.It’s just a matter of editing the css file normally and rebuilding the .gresource file (the execution is fast), it still means an extra step compared to only editing the css file but it’s manageable.
The hard part is setting it up.

EXTRACT

Make a backup of your original gnome-shell-theme.gresource file.
Create a directory yaru-gdm-extract in your ~/home (or a storage disk, whatever as long as not in a system path or the original folder) and change your current directory to it (cd yaru-gdm-extract)

gresource list /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource

Create a subfolder named theme/ and go inside (cd theme)

Create all subdirectories listed under gresource list down the lowest level (important).

Get back to the yaru-gdm-extract directory (“cd …” back to it)

Create a shell script (.sh) with the following

workdir=${PWD}
gst=/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource
if [ ! -d $workdir/theme/ ]; then
mkdir -p $workdir/theme/
fi
for r in gresource list $gst; do
gresource extract $gst $r >workdir/theme{r#org/gnome/shell/}
done

(I took that script from the internet but it didn’t work as it was, it took me a long time to adapt it so that it would work for me, which was the real tricky part for me, but the job is already done and should work for you)

Execute it (sh yourscript.sh)

You should have all the files extracted in yaru-gdm-extract/theme/org/gnome/shell/theme

There might be a cleaner and faster way to extract the files but that’s the one that I managed with my non-geek skills.

EDIT

After that you can edit gdm3.css

REBUILD

And then you’ll need to list all the files in a xml so as to rebuild your initial gresource file with glib-compile-resources (but more on that later).

TRY IT OUT

Errr… might be easier to get rid of ugly GDM3, and use beautiful LightDM instead.

  • it has a dedicated tool to personalize it in Budgie, as @fossfreedom already mentioned.
  • it can follow each user’s background ( beware the path file has read access to anyone ).

I found a much easier way to do it over here:


Download it with:
wget github.com/thiggy01/change-gdm-background/raw/master/change-gdm-background

Set it as an executive with:

chmod +x change-gdm-background

Then change the background with:

sudo ./change-gdm-background /path/to/image
2 Likes

It is indeed much more straightforward. I’m glad you managed to do it so easily!

I don’t regret taking the time to document how to deal with gresource theme files though. I remember I had a hard time due to scarce info around it. So it’s not lost.

It can come in handy for tweaking your own theme (the popular Arc theme comes with gresource). I already had forgotten (didn’t write it down when I first tinkered with it), so now that it’s here the next time I face such files it’ll be much faster and easier for me. And who knows who I might help if a google search leads here.

2 Likes