UPDATE for Ubuntu 23.04
ubuntu-gdm-set-background-23.04
-> has four options just like the previous versions: Image, Color, Gradient Horizontal, Gradient Vertical.ubuntu-gdm-set-background-23.04-transparent
-> sets the login-background color transparent so that the background set viagsettings set com.ubuntu.login-screen background-picture-uri
is visible. This is the RECOMMENDED way.
Please follow this link for setting login background via gsettings
: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1929536
[Test Case]
- Boot a desktop session
- Verify that the greeter shows the default aubergine background.
- Login as the administrator of the machine
- Install systemd-container
- Switch to the GDM user:
$ sudo machinectl shell gdm@ /bin/bash
- Apply a different background with the command:
$ gsettings set com.ubuntu.login-screen background-picture-uri 'file:///usr/share/backgrounds/warty-final-ubuntu.png'
- Logout
- Verify that the greeter now shows the image
warty-final-ubuntu.png
.
ubuntu-gdm-set-background
script (for changing Ubuntu 20.04, 21.04, 21.10, 22.04 & 22.10 GDM Background) HELP
Download the script with one of these commands:
$ wget -q https://raw.githubusercontent.com/PRATAP-KUMAR/ubuntu-gdm-set-background/main/ubuntu-gdm-set-background && chmod +x ubuntu-gdm-set-background
$ curl -fL 'https://raw.githubusercontent.com/PRATAP-KUMAR/ubuntu-gdm-set-background/main/ubuntu-gdm-set-background' -o ubuntu-gdm-set-background && chmod +x ubuntu-gdm-set-background
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 preferred hex color codes.
You may choose colors from 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
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? When you try to change the background with some other scripts and then interact with this script, there could be some conflicts. In case you ran other scripts to change the background and then tried this script, and found conflicts, then add 'rescue' to the end of the command as mentioned above.
Please note that for RESCUE_MODE
active internet connection is necessary