# Compose(5) - man - phpMan

[Compose(5)](https://www.chedong.com/phpMan.php/man/Compose/5/markdown)                               File Formats Manual                              [Compose(5)](https://www.chedong.com/phpMan.php/man/Compose/5/markdown)



## NAME
       Compose - X client mappings for multi-key input sequences

## DESCRIPTION
       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 char‐
       acter.

       The compose file is searched for in  the following order:

       -      If the environment variable **$XCOMPOSEFILE** is set, its value is used as the name of the
              Compose file.

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

       Compose files can use an "**include**" instruction.  This allows local modifications to  be  made
       to  existing  compose  files without including all of the content directly.  For example, the
       system's iso8859-1 compose file can be included with a line like this:
           **include** **"**_%S/iso8859-1/Compose_**"**

       There are several 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)

       _%L_  expands to the name of  the  locale  specific  Compose  file  (i.e.,  "_/usr/share/X11/lo__‐
           _cale/<localename>/Compose_")

       _%S_  expands  to the name of the system directory for Compose files (i.e., "_/usr/share/X11/lo__‐
           _cale_")

       For example, you can include in your compose file the default Compose file by using:
              **include** **"%L"**
       and then rewrite only the few rules that you need to change.  New compose rules can be added,
       and previous ones replaced.

## FILE FORMAT
       Compose files are plain text files, with a separate line for each compose sequence.  Comments
       begin with **#** characters.  Each compose sequence specifies one or more events and a  resulting
       input sequence, with an optional comment at the end of the line:
              _EVENT_ [_EVENT_...] **:** _RESULT_ [**#** _COMMENT_]

       Each event consists of a specified input keysym, and optional modifier states:
              [([**!**] ([**~**] _MODIFIER_)...) | **None**] **<**_keysym_**>**

       If  the modifier list is preceded by "**!**" it must match exactly.  MODIFIER may be one of Ctrl,
       Lock, Caps, Shift, Alt or Meta.  Each modifier may be preceded by a "**~**" character to indicate
       that the modifier must not be present.  If "**None**" is specified, no modifier may 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 **"\x3a"**.  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**
       the result of the composition is always the letter with the "\300" code.  But if the rule is:
              **<dead**___**grave>** **<A>** **:** **Agrave**
       the result depends on how Agrave is mapped in the current locale.

## ENVIRONMENT
       **XCOMPOSEFILE**
              File to use for compose sequences.

       **XCOMPOSECACHE**
              Directory to use for caching compiled compose files.

## FILES
       _$HOME/.XCompose_
              User default compose file if XCOMPOSEFILE is not set.

       _/usr/share/X11/locale/compose.dir_
              File listing the compose file path to use for each locale.

       _/usr/share/X11/locale/<localemapping>/Compose_
              System default compose file for the locale, mapped via compose.dir.

       _/var/cache/libx11/compose/_
              System-wide cache directory for compiled compose files.

       _$HOME/.compose-cache/_
              Per-user cache directory for compiled compose files.

## SEE ALSO
       [**XLookupString**(3)](https://www.chedong.com/phpMan.php/man/XLookupString/3/markdown), [**XmbLookupString**(3)](https://www.chedong.com/phpMan.php/man/XmbLookupString/3/markdown),  [**XwcLookupString**(3)](https://www.chedong.com/phpMan.php/man/XwcLookupString/3/markdown),  [**Xutf8LookupString**(3)](https://www.chedong.com/phpMan.php/man/Xutf8LookupString/3/markdown),  **mkcompose**‐‐
       [**cache**(1)](https://www.chedong.com/phpMan.php/man/cache/1/markdown), [**locale**(7)](https://www.chedong.com/phpMan.php/man/locale/7/markdown).
       _Xlib_ _-_ _C_ _Language_ _X_ _Interface_



X Version 11                                libX11 1.7.5                                  [Compose(5)](https://www.chedong.com/phpMan.php/man/Compose/5/markdown)
