How can I enable numlock on GDM, I’ve tried switching to SDDM and there it is working, but I’d want to enable it on GDM on boot and when I login/logout from session.
Also I’ve tried numerous numlockx services and none of them worked for me.
GDM uses Wayland by default so random services that expect X server will not work. Furthermore, to support both X server and Wayland GNOME is not supposed to be controlled through X-specific settings but rather through gnome-setting-daemon, which abstracts many of the low-level details.
If you have home-manager enabled in your NixOS configuration, you should be able to just set the following for gdm user:
Thank you for detailed explanation, I’m amazed of how powerful NixOS can be.
To make it work, I’ve added a new user - gdm to home-manager, and the following piece of code made it numlock stay on:
Good catch, I forgot that the option was moved from g-s-d to g-d-s, was copying it from my dconf database.
Also note that remember-numlock-state is already true by default:
The reason the numlock-state is not persisted is that we put GDM’s home-directory into a in-memory temporary directory, which gets cleaned when computer shuts down.