xkbevd
Display X keyboard extension events
SYNOPSIS
xkbevd [-display <display>] [-verbose] [-nostart] [-clients <number>] [-nofork] [-file <file>] [-option <option>]
PARAMETERS
-display <display>
Specifies the X display to connect to.
-verbose
Prints additional diagnostic messages to stderr.
-nostart
Does not attempt to start the XKB extension if it is not already running.
-clients <number>
Sets the maximum number of simultaneous client connections (default is 10).
-nofork
Prevents xkbevd from detaching from the controlling terminal and running in the background.
-file <file>
Specifies an alternative configuration file to read event-to-command mappings from.
-option <option>
Passes an option directly to the XKB extension initialization.
DESCRIPTION
xkbevd is the X Keyboard Extension Event Daemon, a utility designed to monitor and react to events generated by the X Keyboard Extension (XKB).
When specific XKB events occur, such as changes in keyboard group (layout), symbols, or modifier states (like Caps Lock or Num Lock), xkbevd can execute predefined shell commands or scripts. This enables dynamic automation and customization based on the keyboard's state within the X Window System.
It typically reads its event-to-command mappings from a configuration file, allowing users or desktop environments to define intricate reactions. It runs in the background, continuously observing the X display for relevant keyboard state changes. While modern desktop environments often handle basic keyboard events, xkbevd remains valuable for advanced custom setups and specific automation needs related to XKB.
CAVEATS
xkbevd operates solely within the X Window System and relies on the X Keyboard Extension (XKB) being active.
Its functionality might be superseded or integrated into modern desktop environments (like GNOME or KDE), which often have their own internal event handlers for keyboard state changes, potentially making direct usage less common for general users.
The daemon's behavior is entirely dependent on its configuration file, which requires understanding XKB event types and basic shell scripting.
CONFIGURATION FILE
xkbevd reads its instructions from a configuration file, typically found at ~/.xkbevd or a system-wide path like /etc/X11/xkbevd/xkbevd.rc. This file contains lines that map specific XKB event types to shell commands. For example, a line might specify that when the keyboard's symbol set changes (e.g., switching between English and a different language layout), a particular script should be executed. The file format is simple, often with lines like: 'event_type' 'shell_command'.
MONITORED EVENT TYPES
xkbevd can monitor various XKB event types. Common ones include:
symbols: Changes in the active keyboard symbols (layout).
group: Changes in the active keyboard group.
modifier: Changes in modifier states (e.g., Caps Lock, Num Lock, Scroll Lock).
bell: When a keyboard bell event occurs.
message: Custom messages sent via XKB.
These events allow for fine-grained control over reactions to keyboard state changes.
HISTORY
xkbevd emerged as part of the X Keyboard Extension (XKB) utilities, developed to provide a more robust and flexible keyboard configuration system than the older xmodmap. XKB itself was introduced in X11 Release 6 (X11R6) to handle complex keyboard layouts, multiple languages, and accessibility features.
xkbevd's role was to provide a daemon that could monitor the new, richer set of events generated by the XKB extension and allow for programmatic responses. This capability enabled advanced features like on-screen indicators for Caps Lock/Num Lock, dynamic keyboard backlighting, or specific application adjustments triggered by keyboard layout changes, which were not easily achievable with previous tools. While its direct use might have lessened with the rise of comprehensive desktop environments, it remains a fundamental component for deep XKB integration and specialized scripting.