xkbcomp
Compile XKB keyboard descriptions
TLDR
Compile keymap for current display
SYNOPSIS
xkbcomp [options] source [destination]
DESCRIPTION
xkbcomp compiles XKB (X Keyboard Extension) keyboard descriptions into binary format or uploads them directly to an X server. It's the core tool for customizing keyboard layouts beyond what setxkbmap provides.
The tool can extract the current keymap from a running X server, modify it, and upload changes. Output formats include XKB source (.xkb), compiled binary (.xkm), and C headers for embedding in applications.
XKB provides advanced keyboard features including multiple layouts, dead keys, compose sequences, modifier handling, and accessibility options that simpler tools like xmodmap cannot achieve.
PARAMETERS
-xkb
Output XKB source format.-xkm
Output compiled binary format.-C
Output C header file.-I dir
Add directory to include search path.-o file
Specify output file name.-v level
Set verbosity level (0-10).-w level
Set warning level.-dflts
Compute defaults for missing components.
CAVEATS
Complex syntax requires understanding XKB architecture. Without $DISPLAY, only creates files without loading. Errors can leave keyboard in unusable state; keep backup layout accessible.
HISTORY
xkbcomp is part of the X Keyboard Extension (XKB), introduced in X11R6 to replace the limited keyboard handling of earlier X versions. XKB provides a comprehensive framework for keyboard configuration that supports internationalization and accessibility features.
