Table of Contents


Compose - X client mappings for multi-key input sequences


The X library, libX11, provides a simple input method for characters beyond those represented on typical keyboards using sequences of key strokes that are combined to enter a single character.

The compose file is searched for in the following order:

If the user's home directory has a file named .XCompose, it is used as the Compose file.
The system provided compose file is used by mapping the locale to a compose file from the list in /usr/share/X11/locale/compose.dir.


include "/usr/share/X11/locale/iso8859-1/Compose"

There are two substitutions that can be made in the file name of the include instruction. %H expands to the user's home directory (the $HOME environment variable), and %L expands to the name of the locale specific Compose file (i.e., "/usr/share/X11/locale/<localename>/Compose").


include "%L"

File Format


Each event consists of a specified input keysym, and optional modifier states:

[MODIFIER_LIST] <keysym>

Each modifier consists of a specified modifier and a state:

(! MODIFIER ) | None
Modifiers may be preceded by a "~" character to indicate that the modifier must not be present.

The result specifies a string, keysym, or both, that the X client receives as input when the sequence of events is input:

"STRING" | keysym | "STRING" keysym

Keysyms are specified without the XK_ prefix.

Strings may be direct text encoded in the locale for which the compose file is to be used, or an escaped octal or hexadecimal character code. Octal codes are specified as "\123" and hexadecimal codes as "\0x123a". It is not necessary to specify in the right part of a rule a locale encoded string in addition to the keysym name. If the string is omitted, Xlib figures it out from the keysym according to the current locale. I.e., if a rule looks like:

<dead_grave> <A> : "\300" Agrave
<dead_grave> <A> : Agrave


File to use for compose sequences.
Directory to use for caching compiled compose files.


User default compose file if XCOMPOSEFILE is not set.
File listing the compose file path to use for each locale.
System default compose file for the locale, mapped via compose.dir.
System-wide cache directory for compiled compose files.
Per-user cache directory for compiled compose files.

See Also

XLookupString(3) , XmbLookupString(3) , XwcLookupString(3) , Xutf8LookupString(3) , mkcomposecache(8) , locale(7) .
Xlib - C Language X Interface

Table of Contents