---
name: "xkbcomp"
section: "1x"
platform: "linux"
package: "xbase-clients"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/xkbcomp/1x"
---

# xkbcomp(1x)

compile XKB keyboard description

## NAME

xkbcomp - compile XKB keyboard description

## SYNOPSIS

**xkbcomp** \[*option* ...\] *source* \[*destination*\]

## DESCRIPTION

The **xkbcomp** keymap compiler converts a description of an XKB keymap into one of several output formats. The most common use for **xkbcomp** is to create a compiled keymap file (*.xkm* extension) which can be read directly by XKB-capable X servers or utilities. The keymap compiler can also produce C header files or XKB source files. The C header files produced by **xkbcomp** can be included by X servers or utilities that need a built-in default keymap. The XKB source files produced by **xkbcomp** are fully resolved and can be used to verify that the files which typically make up an XKB keymap are merged correctly or to create a single file which contains a complete description of the keymap.

*source* may specify an X display, an *.xkb* file, or an *.xkm* file; unless explicitly specified, the format of *destination* depends on the format of the source. Compiling a *.xkb* (keymap source) file generates a *.xkm* (compiled keymap file) by default. If the source is a *.xkm* file or an X display, **xkbcomp** generates a keymap source file by default.

If the *destination* is an X display, the keymap for the display is updated with the compiled keymap.

The name of the *destination* is usually computed from the name of the source, with the extension replaced as appropriate. When compiling a single map from a file which contains several maps, **xkbcomp** constructs the destination file name by appending an appropriate extension to the name of the map to be used.

## OPTIONS

- **-?, -help**

  Print a usage message and exit.

- **-a**

  Show all keyboard information, reporting implicit or derived information as a comment; this option only affects *.xkb* format output.

- **-C**

  Produce a C header file as output (*.h* extension).

- **-d**

  Report debugging information (not supported in all builds).

- **-dflts**

  Compute defaults for any missing components, such as key names.

- **-em1** *message*

  Print *message* before displaying first error message (typically used by the X server).

- **-emp** *message*

  Print *message* at the start of each error message line (typically used by the X server).

- **-eml** *message*

  If there are any error messages, print *message* before exiting (typically used by the X server).

- **-I***dir*

  Search top-level directory *dir* for files included by the keymap description. This option may be used multiple times. After all directories specified by **-I** options have been searched, the current directory and finally, the default XKB data directory (usually */usr/X11R6/lib/X11/xkb*) will be searched.

  To prevent the current and default directories from being searched, use the **-I** option alone (i.e. without a directory), before any **-I** options that specify the directories you do want searched.

- **-l**

  List maps that specify the *map* pattern in any files listed on the command line (not implemented yet).

- **-m** *name,* **-map** *name*

  Compile map from the file *name*, which is expected to contain multiple entries.

- **-merge**

  Merge the compiled information with the map from the server (not implemented yet).

- **-o** *name*

  Direct output to the file *name*. The default is the name of the source file with an appropriate extension for the output format. Specifying ‘-’ as *name* indicates standard output.

- **-opt** *parts,* **-optional** *parts*

  Compile keymap using a list of optional parts. Compilation errors in any optional parts are not fatal. *parts* may consist of any combination of the letters **c**, **g**, **k**, **s**, and **t** which specify the compatibility map, geometry, keycodes, symbols and types, respectively.

- **-p** *count*

  Strip *count* directories from filenames listed.

- **-R***dir*

  Specifies the root directory for relative path names.

- **-synch**

  Force synchronization of X requests.

- **-v** *flags*

  Set level of detail for listing. *flags* are as for the **-l** option.

- **-w** *level*

  Set the threshold of warnings during compilation to the specified *level*. A level of 0 disables all warnings; a level of 10 enables them all.

- **-xkb**

  Generate a source description of the keyboard as output (*.xkb* extension).

- **-xkm**

  Generate a compiled keymap file as output (*.xkm* extension).

## SEE ALSO

[**X**(7x)](/X/7x.md), [**setxkbmap**(1x)](/setxkbmap/1x.md), [**xkbbell**(1x)](/xkbbell/1x.md), [**xkbevd**(1x)](/xkbevd/1x.md), [**xkbprint**(1x)](/xkbprint/1x.md), [**xkbvleds**(1x)](/xkbvleds/1x.md), [**xkbwatch**(1x)](/xkbwatch/1x.md)

## COPYRIGHT

Copyright 1994, Silicon Graphics Computer Systems and X Consortium, Inc.\
 See [**X**(7x)](/X/7x.md) for a full statement of rights and permissions.

## AUTHOR

Erik Fortune, Silicon Graphics
