numlockx

Control the state of NumLock

TLDR

Report whether Num Lock is on or off
$ numlockx status
Turn Num Lock on
$ numlockx on
Turn Num Lock off
$ numlockx off
Flip the current Num Lock state
$ numlockx toggle

SYNOPSIS

numlockx [on|off|toggle|status]

DESCRIPTION

numlockx is a program to control the NumLock key inside X11 session scripts. It's commonly used in login scripts or desktop startup files to ensure Num Lock is in the desired state when a session begins.The command directly manipulates the keyboard LED and state through X11, making it useful for systems where the BIOS Num Lock setting doesn't persist or for users who prefer a specific Num Lock state at login.Without arguments, numlockx turns Num Lock on (equivalent to numlockx on).

PARAMETERS

on

Turn Num Lock on
off
Turn Num Lock off
toggle
Toggle current Num Lock state
status
Display current Num Lock state

INSTALL

sudo apt install numlockx
sudo dnf install numlockx
sudo pacman -S numlockx
sudo zypper install numlockx
nix profile install nixpkgs#numlockx

CAVEATS

Only works in X11 sessions; does not work in Wayland or virtual consoles. The state may be reset by some desktop environments during login. For console Num Lock control, use setleds instead.

SEE ALSO

setleds(1), xset(1), xmodmap(1)