LinuxCommandLibrary

ckbcomp

Compile keyboard description files

SYNOPSIS

ckbcomp [-I DIR] [-l LAYOUT] [-v VARIANT] [-m MODEL] [-o OPTION...] [-r RULES] [-O FILE]

PARAMETERS

-I, --xkb-dir=DIR
    Base directory for XKB components (default: /usr/share/X11/xkb)

-l, --layout=LAYOUT
    XKB layout code (default: us)

-v, --variant=VARIANT
    Variant for the layout (default: none)

-m, --model=MODEL
    Keyboard model (default: pc105)

-o, --option=OPTION
    XKB option (repeatable for multiple)

-r, --rules=RULES
    Ruleset file base name (default: base)

-O, --output-file=FILE
    Output keymap file (default: stdout)

-?, --help
    Show help

--help-all
    All help options

--option-list
    List available options

DESCRIPTION

ckbcomp is a utility from the xkeyboard-config package that assembles and outputs a complete text-based XKB keymap description from high-level specifications such as layout, variant, model, and options. It simplifies creating custom keyboard configurations for the X Window System by combining components from XKB files (rules, symbols, types, compat, geometry). The output is a human-readable keymap file suitable for piping to xkbcomp to generate a binary .xkm file loadable by the X server.

Typically used in scripts or with tools like setxkbmap, it supports standard layouts (e.g., 'us', 'fr') and variants (e.g., 'dvorak', 'nodeadkeys'). Multiple options can stack for complex setups like adding compose key or custom behaviors. Defaults ensure usability without arguments, producing a basic US pc105 layout.

EXAMPLES

ckbcomp -l fr -v nodeadkeys -o grp:alt_shift_toggle | xkbcomp - $DISPLAY
ckbcomp -m macbook79 -l us -o lv3:ralt_switch -O mykeymap

FILES

Uses /usr/share/X11/xkb/{rules,symbols,types,compat,geometry}/*

HISTORY

Developed as part of xkeyboard-config project since X11R7 (2006), replacing ad-hoc keymap tools. Maintained by X.Org Foundation for modular XKB handling.

SEE ALSO

xkbcomp(1), setxkbmap(1), xkbprint(1), xkbcli(1)

Copied to clipboard