← 返回命令列表

Linux command

xkbcomp 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Compile keymap for current display

xkbcomp [keymap.xkb] $DISPLAY

Extract current keymap to file

xkbcomp $DISPLAY [output.xkb]

Compile to binary keymap file

xkbcomp -xkm [keymap.xkb] -o [keymap.xkm]

Generate C header from keymap

xkbcomp -C [keymap.xkb] -o [keymap.h]

Compile with additional include path

xkbcomp -I[/usr/share/X11/xkb] [keymap.xkb] $DISPLAY

Verbose compilation

xkbcomp -v 10 [keymap.xkb] $DISPLAY

说明

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.

参数

-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.

FAQ

What is the xkbcomp command used for?

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.

How do I run a basic xkbcomp example?

Run `xkbcomp [keymap.xkb] $DISPLAY` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -xkb do in xkbcomp?

Output XKB source format.