Ubuntu Change Login Wallpaper
Personally, I think the Ubuntu 22.04 login screen is too plain, and I'm not a big fan of the lock screen either. Currently, Gnome Settings only allows you to change the desktop wallpaper. I remember that previous versions also allowed you to change the lock screen wallpaper. So, after some searching, I discovered that the login screen can be changed, but there's no convenient way to change the lock screen. If anyone knows how, please email me; my email address is in my GitHub profile.
Below is the process for changing the login screen. The login screen in Linux is called the Display Manager. Gnome's is called GNOME Display Manager (GDM). There are other DMs, such as LightDM. If your system has multiple DMs installed, you can only choose one, and this can affect the functionality of other applications. I've experienced this before: after switching to LightDM, the lock screen shortcuts stopped working, forcing me to switch back to GDM3.
Without further ado, let's get started.
1. Download the tool script
wget -qO - https://github.com/PRATAP-KUMAR/ubuntu-gdm-set-background/archive/main.tar.gz | tar zx --strip-components=1 ubuntu-gdm-set-background-main/ubuntu-gdm-set-background
2. Check the file type and help information
If you understand the script, open it with an editor. The script relies on the libglib2.0-dev-bin package, which provides a tool called gresource that can manipulate files ending in .gresource. .gresource files are precompiled binary data files of GTK-3 theme CSS files. This script uses this method to modify the relevant styles.
- image parameter: Changes the login screen wallpaper.
- color parameter: Changes the login screen color (a solid color, no images).
- gradient horizontal parameter: Changes the login screen to a horizontal gradient (gradually transitioning from one color to another from left to right).
- gradient vertical parameter: Changes the login screen to a vertical gradient (no explanation required).
After testing, I still prefer images; they provide more context.
➜ ~ ls -al ubuntu-gdm-set-background -rwxrwxr-x 1 mephisto mephisto 10752 Feb 3 12:41 ubuntu-gdm-set-background ➜ ~ file ubuntu-gdm-set-background ubuntu-gdm-set-background: Bourne-Again shell script, Unicode text, UTF-8 text executable ➜ ~ ./ubuntu-gdm-set-background --help
ubuntu-gdm-set-background script (for changing Ubuntu 20.04, 21.04, 21.10 & 22.04 GDM Background) HELP
there are four options
- background with image
- background with color
- background with gradient horizontal (requires two valid hex color inputs)
- background with gradient vertical (requires two valid hex color inputs)
Tip: be ready with valid hex color code in place of below example like #aAbBcC or #dDeEfF. Change them to your preffered hex color codes. you may choose colors from https://www.color-hex.com/
Example Commands:
- sudo ./ubuntu-gdm-set-background --image /home/user/backgrounds/image.jpg
- sudo ./ubuntu-gdm-set-background --color #aAbBcC
- sudo ./ubuntu-gdm-set-background --gradient horizontal #aAbBcC #dDeEfF
- sudo ./ubuntu-gdm-set-background --gradient vertical #aAbBcC #dDeEfF 5.sudo ./ubuntu-gdm-set-background --reset
- ./ubuntu-gdm-set-background --help
RESCUE_MODE, Example Commands:
- $ sudo ./ubuntu-gdm-set-background --image /home/user/backgrounds/image.jpg rescue
- $ sudo ./ubuntu-gdm-set-background --color #aAbBcC rescue
- $ sudo ./ubuntu-gdm-set-background --gradient horizontal #aAbBcC #dDeEfF rescue
- $ sudo ./ubuntu-gdm-set-background --gradient vertical #aAbBcC #dDeEfF rescue
Why RESCUE_MODE? It is when you try to change the background with some other scripts and then interacted with this script, there will be some conflicts. If you ran other scripts to change the background and then tried this script,
Found conflicts? Then add 'rescue' to the end of the command as mentioned above.
Please note that for 'RESCUE_MODE', an active internet connection is necessary.
3. Change the login screen background image, commonly known as the wallpaper.
In the "image path" field, enter the full path to the image you want to use. Don't be lazy; relogin for the effect to take effect.
➜ ~ sudo ./ubuntu-gdm-set-background --image ~/Pictures/th.jpeg
😕 Seems 'background change is successful'
Changes will be effective after a reboot (CTRL+ALT+F1 may display the changes immediately).
If something goes wrong, log on to a tty and run the following command: $ sudo update-alternatives --quiet --set gdm-theme.gresource /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource
4. Restoring the system
sudo ./ubuntu-gdm-set-background --reset
While this fixes the login screen, there's still a risk of it crashing if you don't use it correctly. If this happens, you'll have to remotely connect to find the corresponding file and restore it. So, I hope the official website will provide relevant configuration options in Gnome settings.
Also, Bing Search's homepage has a different image every day, which can be used as a wallpaper. It's a good idea.
Copyright statement:
- All content that is not sourced is original., please do not reprint without authorization (because the typesetting is often disordered after reprinting, the content is uncontrollable, and cannot be continuously updated, etc.);
- For non-profit purposes, to deduce any content of this blog, please give the relevant webpage address of this site in the form of 'source of original text' or 'reference link' (for the convenience of readers).
See Also:
- Batch Convert PNG Images to WebP
- Install the latest version of Git from source on Ubuntu
- Ubuntu install WeChat
- Ubuntu connects AirPods headphones