LinuxCommandLibrary

xkbvleds

Control keyboard LED states

SYNOPSIS

xkbvleds [options]

PARAMETERS

-display displayname
    Specifies the X server to connect to. If not specified, the DISPLAY environment variable is used.

-help
    Displays a help message.

-version
    Displays the version of xkbvleds.

-led n on|off
    Sets the state of LED number n to on or off. LED numbers typically start at 1 and correspond to Num Lock, Caps Lock, Scroll Lock, etc. The exact mapping may vary depending on the XKB configuration.

-watch
    Continuously monitors the keyboard LEDs. If an LED changes, prints a message to standard output.
It will continuously monitor keyboard led state and output when the state changes.

DESCRIPTION

The `xkbvleds` command is a utility in Linux that allows you to query and control the state of keyboard LEDs (Light Emitting Diodes) using the X Keyboard Extension (XKB). These LEDs typically correspond to status indicators like Num Lock, Caps Lock, and Scroll Lock. The command provides a simple way to retrieve whether these locks are active or inactive, and also to explicitly set or clear these LEDs programmatically. This can be useful in scripting or for applications needing direct control over keyboard LED feedback. xkbvleds interacts directly with the X server, so an X server must be running for it to function. It gives access to the state of the LEDs and allows direct manipulation.
It can be used to synchronize virtual keyboard status with physical keyboard.
The `xkbvleds` command is typically part of the `x11-xkb-utils` package (or similar), which provides various XKB-related tools.

CAVEATS

The specific LED numbers and their corresponding functions can vary depending on the keyboard layout and XKB configuration. Using incorrect LED numbers might not have the intended effect. Requires access to the X server.

LED NUMBERS

The exact LED numbers assigned to Num Lock, Caps Lock and Scroll Lock can vary depending on the system and keyboard layout. Experimentation or consulting system-specific documentation may be necessary to determine the correct mapping.
The xkbvleds command requires an X server to be running.
LED numbers depend on keyboard layout (xkb)

HISTORY

The `xkbvleds` command was developed as part of the X Window System utilities, specifically within the XKB (X Keyboard Extension) suite. Its primary purpose is to provide a command-line interface for querying and manipulating keyboard LEDs, offering a way for users and scripts to interact with these indicators directly. The command is intended to be a relatively simple and low-level tool, focused on providing direct control over the hardware LEDs. As part of X11 it dates back to the late 1980s/early 1990s.

SEE ALSO

xset(1), setxkbmap(1)

Copied to clipboard