Compose(5)
โจ Compose(5) โจ
okay bestie, welcome to the File Formats Manual corner of the libX11 universe ๐ this is your girl's guide to Compose โ the X client mappings for multi-key input sequences. yes it's giving keyboard witchcraft, and yes we're gonna make it make sense ๐ง
๐ธ NAME ๐ธ
Compose โ X client mappings for multi-key input sequences ๐
๐ DESCRIPTION ๐
so here's the vibe: the X library, libX11, ships a lil' input method for characters that your keyboard literally does not have a key for ๐ญ how? by letting you press a sequence of keystrokes that get smooshed together into one single character. iconic behavior, no cap.
the compose file gets searched for in this exact order, bestie โ don't skip steps:
- If the environment variable
$XCOMPOSEFILEis set, its value is used as the name of the Compose file. first come, first served ๐ - 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 is the part where you get to be lazy in the best way โ it lets local modifications 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"
and there are several substitutions that can be made in the file name of the include instruction, so pay attention ๐
:
%Hexpands to the user's home directory (the$HOMEenvironment variable)%Lexpands to the name of the locale specific Compose file (i.e.,"/usr/share/X11/locale/<localename>/Compose")%Sexpands to the name of the system directory for Compose files (i.e.,"/usr/share/X11/locale")
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. lowkey the most powerful little line in the whole file fr fr โจ
๐ฆ 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>
okay so the modifier tea โ:
- If the modifier list is preceded by
"!"it must match exactly. no vibes-based leniency, she's strict ๐ MODIFIERmay be one ofCtrl,Lock,Caps,Shift,AltorMeta.- 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. important, don't add it, she will not recognize it ๐ซถ
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. same keystrokes, different energy depending on your locale, the way that works is so real ๐ญ
๐ ENVIRONMENT ๐
XCOMPOSEFILEโ File to use for compose sequences.XCOMPOSECACHEโ Directory to use for caching compiled compose files. ๐๏ธ
๐ FILES ๐
$HOME/.XComposeโ User default compose file ifXCOMPOSEFILEis 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 viacompose.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), XmbLookupString(3), XwcLookupString(3), Xutf8LookupString(3), mkcomposecache(1), locale(7).
Xlib - C Language X Interface
and that's the whole page bestie, you ate it ๐ ๐ธ go forth and compose your little multi-key masterpieces, main character energy only. this was X Version 11, libX11 1.8.13 โ mwah, see you in the next manpage, ily ๐ซถ๐
๐ฆ where this page comes from
- centos-stream 10: libX11-devel 1.8.13-2.el10 ยท MIT AND X11
- fedora 43: libX11-devel 1.8.13-1.fc43 ยท MIT AND X11
- fedora 43: libX11-devel 1.8.13-1.fc43 ยท MIT AND X11
- fedora 44: libX11-devel 1.8.13-1.fc44 ยท MIT AND X11
- fedora 44: libX11-devel 1.8.13-1.fc44 ยท MIT AND X11
- fedora 44: libX11-devel 1.8.13-3.fc44 ยท MIT AND X11
- fedora 44: libX11-devel 1.8.13-3.fc44 ยท MIT AND X11
- ubuntu resolute: libx11-data 2:1.8.13-1
- ubuntu resolute: libx11-data 2:1.8.13-1ubuntu0.1
- ubuntu stonking: libx11-data 2:1.8.13-1
- Copyright (c) 2009, Oracle and/or its affiliates
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms