xkbwatch
Monitor X keyboard state changes
SYNOPSIS
xkbwatch [options]
PARAMETERS
-compact, --compact
Displays the current XKB state on a single line, updating in place instead of printing new lines for each state change.
-version, --version
Prints the program version information and exits.
-help, --help
Displays a help message with usage information and exits.
DESCRIPTION
xkbwatch is a lightweight command-line utility for the X Window System that provides real-time monitoring of the X Keyboard Extension (XKB) state. It displays the active keyboard indicators, including modifier keys (like Shift, Control, Alt, Super), keyboard groups (different layouts such as English, German), and other XKB status information such as Caps Lock or Num Lock.
This tool is particularly useful for debugging keyboard configuration issues, understanding complex XKB layouts, or simply observing how keyboard states change in response to user input or application actions. It helps users visualize which keyboard components are active, which can be invaluable when troubleshooting unexpected key behavior or when developing applications that interact with the keyboard state. xkbwatch continuously updates its display, making it a dynamic tool for keyboard diagnostics.
CAVEATS
xkbwatch requires an active X server connection to function, as it monitors the state of the X Keyboard Extension. Its output can be verbose without the -compact option, logging every state change. It is primarily a diagnostic and debugging tool for XKB configurations, not for general user interaction or keyboard configuration.
OUTPUT FORMAT
The output of xkbwatch typically displays active keyboard indicators. This includes modifier states (e.g., Shift, Lock, Control, Mod1-Mod5), which correspond to keys like Shift, Caps Lock, Ctrl, Alt, and Super/Meta keys. It also shows the currently active keyboard group (e.g., Group1, Group2), indicating which keyboard layout is currently in use. Other indicators like NumLock or ScrollLock may also be displayed if active.
Without the -compact option, each change in state results in a new line of output, providing a continuous log of keyboard state transitions. When -compact is used, the output updates on a single line, making it suitable for display in a terminal without scrolling.
HISTORY
xkbwatch is part of the x11-xkb-utils package, which provides essential utilities for interacting with the X Keyboard Extension (XKB). XKB itself was introduced to the X Window System to offer a more flexible and powerful keyboard configuration system than its predecessor, Xmodmap. As an integral diagnostic tool, xkbwatch allows users and developers to inspect the real-time state managed by XKB. Its core functionality has remained consistent, serving its specific role as a reliable state monitor within the XKB ecosystem since its widespread adoption.