xkbprint
Print X keyboard layout
SYNOPSIS
xkbprint [options] [file]
PARAMETERS
-display
Specifies the X display to use.
-host
Specifies the host containing the X server.
-file
Specifies a compiled keymap file to use instead of querying the server.
-device
Specifies the XKB device ID of the keyboard.
-eps
Generates Encapsulated PostScript output.
-color
Generates color output (PostScript only).
-bw
Generates black and white output (PostScript only).
-geometry
Specifies the page geometry (e.g., A4, Letter).
-label
Specifies what to print on keycaps (symbols, names, etc).
-key
Print only specified keycode.
-section
Specifies a section to print (keycodes, types, compat).
-symbols
Print specified key symbols.
-rows
Specify how many rows to print, used to adjust output density.
-split
Split output among multiple pages if required.
-outfile
Writes the output to the specified file.
DESCRIPTION
The xkbprint command generates a printable or PostScript description of an X Keyboard Extension (XKB) keyboard description. It can be used to create hardcopy layouts for users or developers. xkbprint retrieves the keyboard description from the X server or from a compiled keymap file specified on the command line. It can format the output in a variety of layouts to show key symbols, groups, modifiers, or other keyboard features.
The primary function of xkbprint is to display keyboard layouts for various XKB configurations. This tool supports detailed customization through various options, allowing users to specify the target display, keymap source (server or file), output file, and layout parameters such as color mode, key arrangement, and section selection. By leveraging different command options, users can generate different outputs, from simple keycap labels to complex keyboard diagrams complete with modifier mappings. This versatility makes xkbprint useful for documenting customized keyboard setups, troubleshooting configuration issues, and creating visual aids for keyboard training or accessibility purposes.
CAVEATS
The quality of the generated output depends heavily on the font configuration of the system and the available fonts. Some special characters or less common symbols may not render correctly if appropriate fonts are not installed.
EXAMPLE USAGE
To generate a black and white PostScript file of the keyboard layout, using the default display and saving the output to "keyboard.ps", the command would be: xkbprint -eps -bw -outfile keyboard.ps.
To get help information: xkbprint -help