NumLock is a special key that can be used to turn the number pad on full-size keyboards on and off. You can toggle the NumLock key from software using several simple programs. You can also make it permanently enable the number pad, thereby disabling NumLock.
General XOrg Configuration
Turning NumLock on/off Using Software
The ancient and very simple program
numlockx lets you turn NumLock on and off. It has very simple options:
|on||Turn NumLock on (default)|
|off||Turn NumLock off|
|toggle||Change NumLock status (on if off, off if on)|
|status||Check the NumLock status (in case your keyboards indicator light is broken)|
You can put
numlockx on & in
~/.xinitrc to ensure that NumLock is turned on when you login to your window manager / desktop environment.
Fun fact: The latest numlockx version, 1.2, was written by Lubos Lunak and Oswald Buddenhagen in 2001. It still works like it always has.
Permanently Enabling NumLock
setxkbmap has an option called
numpad:mac that will permanently enable the number pad. If you run
setxkbmap -option numpad:mac
the number pad stays on (NumLock on) regardless of what you do. This option is only for those who want NumLock to be on and stay on and never turn off, ever.
Using The Number Pad As A Mouse
You can use your number pad in X as a mouse by pressing ⇧ Shift+NumLock. Some distributions disable this feature. See HOWTO use the numeric keyboard keys as mouse in XOrg for the X configuration you need if that's the case and the keys you should press to do mouse clicks and use the number pad as a mouse.
, or . On The Number Pad
This isn't very related to NumLock but it's slightly relevant:
Option "XkbVariant" ",," will make the number pad's comma key output
. regardless of what keyboard layout is in play.
We do not know why
",," translates to
. - it's just the way it is.
The Mate desktop environment tries to remember the NumLock status and re-apply it when you login. You can override this with some
dconf values. You can set those with:
numlock-state 'on' with
numlock-state 'off' if that is your preference.
Xfce has a value called
Numlock for the default Numlock status and
RestoreNumlock which decides if Xfce should remember the Numlock status or not in the
keyboards channel. Both need the
/Default prefix. You can change these settings with
xfce4-settings-editor or using
xfconf-query in a terminal. You will need to
RestoreNumlock if you never changed it.
The Linux Kernels Virtual Console
setleds lets you configure NumLock status in VT TTYs (not X or Wayland). It may sound like it is a program only written to control the LED lights, but it's not.
If you want NumLock on when you login to a virtual terminal (those at ctrl+alt+f1 to ctrl+alt+f12) you can do it by creating a simple script:
and a systemd service that runs that script:
-num to always turn NumLock off.