How to set GNOME(a.k..a GDM) greeter (a.k.a lockscreen/login) background(a.k.a wallpaper)?

I simply want to show a background image on the GNOME login screen.

I was able to change my desktop background/wallpaper by placing this in my home manager configuration:

dconf.settings = {
    "org/gnome/desktop/background" = {
        "picture-uri" = "/home/me/.background-image";
    };
    "org/gnome/desktop/screensaver" = {
        "picture-uri" = "/home/me/.background-image";
    };
};
home.file.".background-image".source = /path/to/my/background.jpg;

But that’s just my desktop. I want to change my login screen background. Currently, the login background is just a blank color. How do I change it?

1 Like

That is not supported by GDM but you can easily change GNOME Shell as per the instructions on the Arch wiki using Nixpkgs overlay.

Thanks, but I’m on day 4 of NixOS and what you just said is way over my head. I tried following [1] and posted my results. Maybe you could response to that?

[1] GDM Background Image and Theme - #2 by DiCaius

It seems the CSS property of interest here is lockDialogGroup. Grepping across my entire system for css files that contain lockDialogGroup gives me this:

/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta/gnome-shell/gdm3-Adapta.css:1224:#lockDialogGroup { background: #222d32 url("resource:///org/gnome/shell/theme/noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta/gnome-shell/gnome-shell.css:1224:#lockDialogGroup { background: #222d32 url("noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Eta/gnome-shell/gdm3-Adapta-Eta.css:1224:#lockDialogGroup { background: #222d32 url("resource:///org/gnome/shell/theme/noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Eta/gnome-shell/gnome-shell.css:1224:#lockDialogGroup { background: #222d32 url("noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Nokto/gnome-shell/gdm3-Adapta-Nokto.css:1224:#lockDialogGroup { background: #222d32 url("resource:///org/gnome/shell/theme/noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Nokto/gnome-shell/gnome-shell.css:1224:#lockDialogGroup { background: #222d32 url("noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Nokto-Eta/gnome-shell/gdm3-Adapta-Nokto-Eta.css:1224:#lockDialogGroup { background: #222d32 url("resource:///org/gnome/shell/theme/noise-texture.png"); background-repeat: repeat; }
/nix/store/sgw1qin31ii4hxy1vq4j03q18kf4i18p-adapta-gtk-theme-3.95.0.11/share/themes/Adapta-Nokto-Eta/gnome-shell/gnome-shell.css:1224:#lockDialogGroup { background: #222d32 url("noise-texture.png"); background-repeat: repeat; }

But that says adapta, so must be irrelevant, because GNOME currently thinks my theme is adwaita:

$ gsettings get org.gnome.desktop.interface gtk-theme

'Adwaita'

So, I don’t understand which css file to tweak lockDialogGroup.

Yes, that thread is precisely what I meant and will change the greeter background as you want. You will want to save the diff as a patch file relative to the Nix file that refers to it. wallpaper refers to some package that contains a gnomeFilePath attribute but you can just point backgroundPath directly to a file, e.g. ./my-background.png. You will also need to change gnome3 to gnome.

The patch in the other thread should take care of the file modification. You will probably not be able to grep for the CSS value since gnome-shell packs the theme files into gresource files (think something like a tarball).

I managed to get this working. See my solution at GDM Background Image and Theme - #4 by notfed