How to change login screen background?

Itโ€™s actually using lightdm-gtk. To change the background for the login change โ€œbackground =โ€ line in the file โ€œ/etc/lightdm/lightdm-gtk-greeter-ubuntu-mate.confโ€ and make it point to whatever image you want to use (for example: โ€œbackground = /usr/share/backgrounds/41621_anime_scenery.jpgโ€). I usually copy the image to โ€œ/usr/share/backgroundsโ€ and make sure the permissions give everyone read access at least.

1 Like

Thanks very much for your reply, Iโ€™ll give that a go :smiley:

2020 and now the first item in the Control Panel under Administration is "Login Window". Very user friendly.

It shows you the path where the images are coming from if you want to add one of your own. Only catch could be making sure everybody has permission to read the file.

May 2022
Now under UM 22.04
Can't figure how to change login screen background
And there is no item in the Control Panel under Administration named "Login Window"
I've looked through other posts, used a few 'tricks' recommended, but no use.
What is it that I am missing ?
Thanks
W

1 Like

Some things changed under the hood which resulted in a bug.
See this:

and this:

and the "won't fix" answer of the author.

so you have to edit a configfile manually:
sudo pluma /usr/share/glib-2.0/schemas/30_ubuntu-mate.gschema.override

and change the background= entry

then recompile the schemas:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/.

This seems to be the accepted workaround for the time being.
It lacks a bit in elegance I'm afraid. But it works pretty well.

3 Likes

See also this solution

Is there any EASIER way to change the login screen like the previous version which was way easy to change the background !!!!! :face_with_raised_eyebrow: :laughing: :laughing: :hot_face:

EDIT: improved code

Not that I know, I am eager to know if there is any.

At the moment I use this:

  1. copy & paste this to a file
#!/bin/bash

exec &>/dev/null
source "$HOME/.config/user-dirs.dirs"

text1="Login Background Changer"
text2="Select Background for Login"
mybg="/usr/share/backgrounds/mybackground"
schemadir="/usr/share/glib-2.0/schemas"
configfile="$schemadir/30_ubuntu-mate.gschema.override"

tmpfile="$XDG_RUNTIME_DIR/delete_me_$$"
cleanup()
{
	rm $tmpfile
	sudo -k
}
trap "cleanup" INT TERM EXIT

zenity --title="$text1" --password | sudo -S true || exit

if ! grep "background='$mybg'" "$configfile"
then
	sudo sed -i "s|background=.*|background='$mybg'|g" "$configfile"
	sudo glib-compile-schemas "$schemadir/."
fi

eom "$mybg" &

sleep 1
cp "$(zenity --title="$text2" --file-selection --filename="$XDG_PICTURES_DIR/*")" "$tmpfile" || exit
sudo cp "$tmpfile" "$mybg"

eom "$mybg"
  1. make that file executable.

from now on I only have to click the file whenever I want to change the background of the login screen.

Yeah, it's not ideal but it's at least a decent workaround for the time being.

2 Likes

Zenity is very limited in functions. I prefer Yad dialog.
However Debian still packages ancient gtk2 version of yad,
bullsye having 0.40.0-1, bookworm/sid have 0.40.0-1+b1,
which is binary NMU (Non-maintainer upload) since there is +b suffix at the end.
There is a bug report but not addressed. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919785
And Ubuntu pulls from Debian.

Current Yad version is 12 on Github. Releases ยท v1cont/yad ยท GitHub
Anyway even with such an old version much more can be achieved with yad than zenity.

1 Like

I totally agree :slight_smile:
I like yad , it can do multiple things in a single window, it is indeed a major enhancement compared to zenity.

One step beyond yad is gtkdialog which can be used to build complete graphical interfaces.
It has become abandoned, picked up again, forked at least three times etc. so although it is a pretty good interface for bash scripts, and I really love it, its future is uncertain.

The only reason i reverted to zenity for this hack is the fact that it is already present on every Ubuntu-MATE install so nobody needs to install extra packages to get this running.

I had some thoughts about doing this in gtk/glade + C or wxglade + python but that is a bit much work for what I consider as a temporary stopgap. Also a bit harder to post in the forum. :grin:
It would be much less work to revert to the old tried and tested slick-greeter.

So that is how i came to dig up the old zenity :slight_smile:

Hey guys,

I have figured it out how to change the Boring Login Screen in Ubuntu Mate 22.04

Check the picture and you will see the path and with image file should be changed in order to have a nice login screen once you log out. :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :sunglasses: :sunglasses:

Just change the image with maintaining the same image file and enjoy...

1 Like

seems too easy! But I'll try it!

This solution is working for me, thanks!

doing this worked! Easy Peasy!

Yes, it works. Thank you very much.

It works for me, thank you!

It didn't work with a .jpeg image all I got was a black screen, but I saved the image as a .png and then it worked.

been told that the file is included in the default Jammy wallpapers, so if that gets updated, your changes will be lost and image will revert to the original one.

It seems the easiest way.

For those of us for whom this method still didn't work (until now).
SOLUTION
Ubuntu MATE 22.04
CHANGING THE IMAGE OF THE LOG IN SCREEN

STEP ONE - we tried that

You have to open a specific file and edit it manually. The file is 30_ubuntu-mate.gschema.override. It is in /usr/share/glib-2.0/schemas/. You have to open it as admin using sudo from terminal. The command is:

sudo pluma /usr/share/glib-2.0/schemas/30_ubuntu-mate.gschema.override

You have to edit line 2 in that file. The line in my case contain:

/usr/share/backgrounds/ubuntu-mate-jammy/Jammy-Jellyfish_WP_4096x2304_Green.png

This is the path to the original image used, the one you see in the log in screen, and the one you want to change. Change it. Replace the path with the desired image. In my case this is:

background='/usr/share/backgrounds/MyDesktops/1c7f5dc499af5f6a61619b6c3dabec2f78804404.jpeg

The image file that is going to be used in the log in screen is now replaced.

STEP TWO - the solution explained

Please read, that's the important bit:

My file is in /usr/share/backgrounds/MyDesktops/.
I moved MyDesktops folder there. It contained my images.

Everything you do in /usr/share, perhaps everything in /usr at all is admin protected.
To do any changes you must to do it from the terminal. You can't just copy/paste new files there. You have to move them manualy (from the terminal) with sudo (admin) autorisation.
Needless to say, you have to put your password there. In my case I moved the folder with:

sudo mv /home/rock/Pictures/MyDesktops /usr/share/backgrounds

I believe the reason this method didn't work for some users is that the path they may have specified is path to a home folder. So when the script execute it doesn't bypass the admin restriction or something (I am guessing). In my case it ignored the line in the script and it moved to the next line which was about the background color. That was the color that loaded instead of any image. That is why I moved the image folder in /usr/share/backgrounds/.

I believe this folder is important on system level. So the file you want to use for that function must be inside '/usr/share/backgrounds/'.

So I did it and it didn't work. I forgot step three.

STEP THREE - the sweet bit

You have to compile the file. In the terminal type:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

As of the moment of typing this I haven't tested my theory.
Now, I just compiled it, let me log out and see if it has worked.

You should see the smile on my face.

It worked!

PROBLEM SOLVED