LinuxCommandLibrary

numlockx

TLDR

Show the current number lock status

$ numlockx status
copy
Turn the number lock on
$ numlockx on
copy
Turn the number lock off
$ numlockx off
copy
Toggle the current state
$ numlockx toggle
copy

SYNOPSIS

numlockx [on|off|toggle|status]

DESCRIPTION

numlockx controls the Num Lock key state in X11 sessions. 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

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), xdotool(1)

Copied to clipboard