A simple script to set a custom background image for the GDM (login screen) on GNOME 45 and newer (45+).
This script automates the process of changing the GDM background by modifying the gnome-shell-theme.gresource file.
You must have the following command-line tools installed:
glib-compile-resources(often inlibglib2.0-devorglib2-devel)gresource(often inlibglib2.0-binorglib2)ImageMagick(magick) — only required if you use the blur option
sudo dnf install glib2 glib2-devel ImageMagickgit clone https://github.com/kem-a/gnome-gdm-wallpaper && cd gnome-gdm-wallpaper && chmod +x set-gdm-wallpapersudo ./set-gdm-wallpaper -i /absolute/path/to/image.png -b 8sudo ./set-gdm-wallpaper -r| Argument | Description |
|---|---|
-i, --install <image> |
Install a custom wallpaper for GDM from an absolute image path (.png/.jpg/.jpeg). |
-b, --blur <XX> |
Blur the wallpaper using ImageMagick before installing. Recommended: 5–15 (try 8); usable range ~1–30+. Requires magick. |
-r, --remove |
Restore the default GDM theme and delete all custom backups created by the script. |
-h, --help |
Show usage help and exit. |
Warning: The script will prompt you before restarting the GNOME Display Manager (
gdm). Restarting GDM will immediately terminate your current user session and log you out. Save any open work before running it. If you choose not to restart GDM immediately, you must do so manually (or reboot) for the wallpaper change to take effect.
The script automatically creates a timestamped backup of the original theme file in /usr/share/gnome-shell/ with a name like gnome-shell-theme.gresource.bak-YYYYMMDD-HHMMSS.
To restore the original login screen, you can list the backups and copy one back into place.
-
Find a backup:
ls -l /usr/share/gnome-shell/gnome-shell-theme.gresource.bak-* -
Copy the backup over the modified file (you will need
sudo):sudo cp /usr/share/gnome-shell/gnome-shell-theme.gresource.bak-20250829-123456 /usr/share/gnome-shell/gnome-shell-theme.gresource
-
Restart GDM to see the change:
sudo systemctl restart gdm
This project is licensed under the MIT License - see the LICENSE file for details.