To change the GDM (lock/login screen) theme, you need to replace the system's default GNOME Shell theme.
- If the replacement fails, your desktop environment will not work properly. So please be careful if doing this.
- When applying this, other third-party GNOME Shell themes would look broken until you restore to the original theme.
- If GNOME Shell has been updated and restored to the original theme, you will need to install this again.
Tip: On Arch Linux, you can automatically reinstall the GDM theme by creating a hook file. For example, if you use Materia-compact as your GDM theme, put this file in the
/usr/share/libalpm/hooks/
directory.
glib-compile-resources
— The package name depends on the distro.glib2
(Arch Linux)glib2-devel
(Fedora, openSUSE, etc.)libglib2.0-dev-bin
(Debian, Ubuntu, etc.)
libxml2-utils
— Ubuntu users only.
- Back up the original theme file first. If you are already using a custom GDM theme, skip this:
sudo cp -av /usr/share/gnome-shell/gnome-shell-theme.gresource{,~}
- Select a GTK theme to decide which variant to install.
- Replace the default theme file:
THEME_NAME="$(gsettings get org.gnome.desktop.interface gtk-theme | sed "s/'//g")"
THEME_SRC_DIR="/usr/share/themes/$THEME_NAME/gnome-shell"
sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" --sourcedir="$THEME_SRC_DIR" "$THEME_SRC_DIR/gnome-shell-theme.gresource.xml"
- Reload the theme. If you are running GNOME Shell, press Alt + F2 then type
rt
.
- Restore to the original theme file from the backup:
sudo mv -v /usr/share/gnome-shell/gnome-shell-theme.gresource{~,}
- Reload the theme. If you are running GNOME Shell, press Alt + F2 then type
rt
.