UPDATE: For Ubuntu 22.04 and Ubuntu 24.04, there’s now a graphical tool to do the job, see this tutorial for details.
This simple tutorial shows how to easily change the login screen background wallpaper or solid color in Ubuntu 20.04 Gnome desktop.
There’s no setting option to change GDM3 login screen background unless hacking on the the style sheet file, though it was fairly straightforward to edit the content in Ubuntu 18.04 and Ubuntu 19.10.
In Ubuntu 20.04, you have to extract the css file from current theme’s .gresource
file, then edit the content and recompile to create the new .gresource
file, and finally set it as default.
Change Login screen background via script:
Thankfully, there are a few scripts in Github to make things simple. And here’s the one that works on Ubuntu 20.04, Ubuntu 20.10, and Ubuntu 21.04.
1.) First open terminal via Ctrl+Alt+T key combination and run command to install the required libraries:
sudo apt install wget libglib2.0-dev-bin
2.) Then download the script via wget command line downloader:
wget github.com/thiggy01/change-gdm-background/raw/master/change-gdm-background
you can also download the script in github web page.
3.) After downloaded the script, add executable permission to the file by running command:
chmod +x change-gdm-background
4.) And finally run command to set your photo image as login background:
sudo ./change-gdm-background /PATH/TO/IMAGE
Besides typing the path to image manually, you can type “sudo ./change-gdm-background” in terminal, then hit space bar to input a blank space, and finally drag & drop the image from file manager to terminal window.
Type user password (no visual feedback) when it asks and hit Enter. IMPORTANT: After successfully changed the login screen background, it asks whether to restart GDM to apply changes. Answer yes will log out current session, so it’s important to backup your work before hitting enter!
3.(Optional) To restore changes, run command:
sudo ./change-gdm-background --restore
Save the script for future use:
If you like the script and want to keep it for user later, run command to copy it to /usr/local/bin directory:
sudo cp change-gdm-background /usr/local/bin
After that, you can run the script any time in terminal window via:
sudo change-gdm-background /PATH/TO/IMAGE
Worked perfectly, thank you!
Hi dude,
why images show in zoom config?
I have the same issue… :(
Hi,
I get a syntax error on the first line;
syntax error near unexpected token `newline’
`’
Am I missing something?
Here is my system.
Linux red-Inspiron 5.4.0-31-generic #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Thanks.
hi when i try to execute the script after inserting the desired images path it says that the image path doesn’t exist. i write the path like this /home/pictures/wallpapers/fag.jpg
any help is appreciated!! happy linuxing!!
Make sure you typed correct file path.
Open the folder with the picture image and press Ctrl+L on keyboard, it will show you the path in file browser header bar
Is you username “pictures” or is pictures a directory in your home? It appears that you may have left your username off the path. i.e.:
/home//pictures/wallpapers/fag.jpg.
I am getting a “sudo: ./focalgdm3: command not found” error when trying to run the script. I tried renaming it to *.sh with the same results.
@lavas “sudo bash ./focalgdm3 –set”, and you have to install “libglib2.0-dev” from “https://pkgs.org/search/?q=libglib2.0-dev”.
@Ji M, your focalgdm3 requires libglib2.0-dev “https://pkgs.org/search/?q=libglib2.0-dev”, and it works successfully.
after running the script it shows
“wget ‘https://github.com/PRATAP-KUMAR/focalgdm3/raw/master/focalgdm3.sh’
–2020-07-04 11:50:34– ‘https://github.com/PRATAP-KUMAR/focalgdm3/raw/master/focalgdm3.sh’
Resolving github.com (github.com)… 13.234.210.38
Connecting to github.com (github.com)|13.234.210.38|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2020-07-04 11:50:35 ERROR 404: Not Found.”
Post updated! The project maintainer changed the script name from focalgdm3.sh to focalgdm.
I have the same Issue as 2 people above, running 2 monitors and the image is spanning the both monitors, I’ve tried using Gnome Tweaks to set it but it doesn’t seem to make any difference, any ideas on how to fix it would be greatly welcomed.
Didn’t work for me. Instead of displaying my picture, it displays a plain one color background.
Worked like a charm, thanks!
make sure ‘p’ is in caps in pictures.= /home/Pictures.
check if your directory names are proper, that’s all.
Works perfect!!!
worked like a charm, even in 2021 thanks!!
I just select Administration/Login Window from the Ubuntu menu.
Adjust parameters as needed.
What pinhead authorized this brain-damaged login program to be used for 20.x? Customization requiring compiling with obscure programs not provided with the operating system went out of acceptability back when X11R4 came out.
USE PLAIN TEXT RESOURCE FILES, or don’t force users to use this stupid login program.
I hate the purple used and I’m already sick of looking at it every single time I login. As a cranky old Unix wizard from the 1980s and 90s, I expected the current state of the art to be at least as evolved as X11R4.
The current login program is backward and indicates a distribution focused more on forcing arbitrary (and bad) taste on the users in a way they cannot reasonably easily escape than giving them the flexibility they have a right to expect from any OS in the 21st century.
I’m new enough to Ubuntu that there is little switching cost to moving to another distribution (like GNU/Linux Standard Edition) where I can build the X system up myself using the STANDARD programs which support TEXT FILE customization via resource files.
Not an ideal solution, but if this is Ubuntu’s new future, I will be leaving it. A very bad way to start a relationship with users is by showing how arrogant the vendor is by pulling crap like this.
20.x has other serious flaws. Such as the Media Server they’ve superglued to the OS, namely Rygel (they didn’t even change the name of the executable) is garbage. It generates useless filenames that do not even include the filename of the files in question (the format of which cannot be changed) [shades of login’s arrogance] and misreports files as directories and doesn’t work properly with them.
This wouldn’t be a problem, I would just turn if off and run something that works properly, like ps3server. But again in their arrogance they have removed all such programs from the 20.x repository so you cannot do so.
Sorry for the novel. But as there is no real way to convey my frustration to Ubuntu, and given their arrogance are unlikely to give a damn, I want it in print somewhere.
As this is the only article I’ve found online that even admits to this bit of brain-damage in the login program, I am doing it here.
I haven’t even mentioned the pathetic implementation of adding icons for custom programs to the desktop manager is. With an executable path, a comment, and an image file, you should have all you need to make it work. That isn’t the case in 20.04, though it seems to have been the case up until 20.x.
As of 20.04 on Oct 1st, 2021, the above screen capture and usage syntax are wrong. The download instruction is correct. But for proper invocation see the bundled README.md file. Basically if you (via sudo) run the script (the examples above and mine below assume you are in the directory you unpacked the script in), it takes one argument.
If that argument is an absolute path name to a image file _with no spaces in the name_, it is set as the background image of the login screen. for example:
sudo ./focalgdm3/focalgdm3 /home/johndoe/Images/Backgrounds/Beauty.png
If that argument is a # and a hex color code, the theme color will be set to it. In this example a moderate pure green.
sudo ./focalgdm3/focalgdm3 \#00AA00
–set is not recognized (nor needed) and I bet –reset is not either (even if you do needed it).
This Crap does not work.
Sorry abut my time.
———————–
cp: Aufruf von stat für ‘/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource’ nicht möglich: Datei oder Verzeichnis nicht gefunden
Don’t know how to handle /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource~
Don’t know how to handle /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource~
cp: reguläre Datei ‘/tmp/gdm3-theme/theme’ kann nicht angelegt werden: Datei oder Verzeichnis nicht gefunden
Can’t open /tmp/gdm3-theme/theme/gdm3.css: Datei oder Verzeichnis nicht gefunden.
./change-gdm-background: Zeile 149: /tmp/gdm3-theme/theme/gnome-shell-theme.gresource.xml: Datei oder Verzeichnis nicht gefunden
Don’t know how to handle /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource~
./change-gdm-background: Zeile 154: /tmp/gdm3-theme/theme/gnome-shell-theme.gresource.xml: Datei oder Verzeichnis nicht gefunden
./change-gdm-background: Zeile 156: /tmp/gdm3-theme/theme/gnome-shell-theme.gresource.xml: Datei oder Verzeichnis nicht gefunden
Failed to open file “/tmp/gdm3-theme/theme/gnome-shell-theme.gresource.xml”: Datei oder Verzeichnis nicht gefunden
mv: Aufruf von stat für ‘/tmp/gdm3-theme/theme/gnome-shell-theme.gresource’ nicht möglich: Datei oder Verzeichnis nicht gefunden
something went wrong.
mv: Aufruf von stat für ‘/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource~’ nicht möglich: Datei oder Verzeichnis nicht gefunden
No changes were applied.
rm: das Entfernen von ‘/tmp/gdm3-theme’ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
This worked a treat on my Ubuntu 20.04 – no more purple screen! Thanks
Worked fine for me, and instructions were clear, don’t know what the others are moaning about. many thanks!
Thanks but this does not work in UBUNTU VERSION=”22.04 (Jammy Jellyfish)” any chance you could help please
GNOME desktop in Ubuntu 22.04 is not freeze now. As I’m not a programmer :(, no ability to hack the script.
The only thing that works for me.THX Ji m.
And i am Linux Newbie :-(
Greetz from Germany
Howdy! Thank God for young men like you. Although I understand the lingo, commands are not my forté. I knew there had to be a way, just did not know. Thank you, thank you, thank you, I no longer have to start at a purple screen when I log in. Hahaha. Kudos, and keep up the good work. One coffee, coming up!
These instructions worked like a charm for me. Thank you! My only issue is that the image is stretched across my two monitors and looks horrible. I don’t know how to fix that yet.