I am running Debian GNOME 8.0. I would like to have Numlock ON as default.

So I followed the instructions on this page:

https://wiki.archlinux.org/index.php/Activating_Numlock_on_Bootup#GDM replacing gdm by gdm3 for my case.

This turns Numlock ON at login. But then, after login, Numlock is automatically switched OFF again, and I cannot figure out how to leave it ON.

I looked at this page :

Keep NumLock always on

and edited my .bashrc file to add this line:

xmodmap -e "keycode # = """

which works to disable Numlock key. But since Numlock is OFF when my session opens, I could not turn it ON anymore! Thus it did not solve my problem. That would be useful if my Numlock was ON by default. (I re-enabled the Numlock key).

As information, I had initially installed Debian LXDE, but added GDM to switch to GNOME, and then removed and purged lxde* and lightdm*. I feel like this is the reason for my problem, since:

  • I found on the web that LXDE switches numlock OFF as default

  • my other computer, on which I installed Debian GNOME natively, does not have this problem.

I am sure to be using GNOME since:

pierre@Ockham:~$ echo $XDG_SESSION_DESKTOP 
pierre@Ockham:~$ echo $GDMSESSION 
pierre@Ockham:~$ echo $XDG_CURRENT_DESKTOP 

However, just in case lightdm would still play a role, I did try to follow the instructions on that page:


and that one:


but it did not solve the problem.

Does anybody have an idea?

By the way, the /etc/xdg/ folder still contains LXDE and Openbox (which I also removed) folders:

pierre@Ockham:/etc/xdg$ ls
autostart  libfm  lxlauncher  lxpanel  lxsession  menus  openbox  pcmanfm  systemd  user-dirs.conf  user-dirs.defaults

Is it normal or should I remove them? And how?

  • 1
    With gnome 3,if numlock is ON and you logout/reboot/restart it should remember the last state... What's the output of gsettings get org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state ? – don_crissti Oct 12 '15 at 22:24
  • Hi don_crissti ! The command returned false so I changed it to true with the dconf editor. Now everything is fine, thanks a lot ! – pmassat Oct 13 '15 at 21:13

The solution was actually very simple (see @don_crissti 's comment): set the dconf key remember-numlock-state (under org > gnome > settings-daemon > peripherals > keyboard) value to true via dconf-editor or in terminal:

gsettings set org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state true
  • 1
    It works! Thanks, @don_crissti, and you for asking/signal-boosting. I like GNOME, but wow, they hate options. Why bury this so far below the real GUI? (dconf-editor barely qualifies as a GUI app.) I know you don't want to clutter up your DE with endless options, but c'mon, you're at the other end of the absurd scale now. Use your great toolkit and those design skills you're always trumpeting about - and find a way to make it work. Gah. ...Having said that, why require an option when the OS could honour whatever the firmware sets at boot? but that's a general Linux thing, not GNOME-specific – underscore_d Jul 25 '16 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.