Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

hpr3523 :: The Compose key

What is the compose key, and how to set it up on X, GNOME and Windows.

<< First, < Previous, , Latest >>

Hosted by dnt on 2022-02-02 is flagged as Clean and is released under a CC-BY-SA license.
Xorg,X11,compose,composekey. 1.

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:06:46


The Compose key allows you to input any character or sequence of characters regardless what keyboard layout you use, by typing the Compose key followed by a sequence of other keys. To use it, you must activate it in your system and choose what key you want to serve as the Compose key.

If on Windows, we don't judge, we understand it's because, like me, you have no choice, and that's OK, one day we'll all get to live the dream, until then we'll just make do... WinCompose enables the compose key on that wretched environment. It comes with a ton of additional sequences, plus a fancy GUI for creating your own.

If you use X, I suggest looking at the ArchLinux Wiki:

If you are a GNOME user, install GNOME Tweaks to activate the Compose key.


include "%L"
<Multi_key> <Multi_key> <braceleft> : "&#123;"
<Multi_key> <Multi_key> <braceright> : "&#125;"
<Multi_key> <Multi_key> <t> <f> : "(╯°□°)╯︵ ┻━┻"
<Multi_key> <C> <C> <C> <P> : "☭"

Note that that last one actually comes with X by default. In ArchLinux, all the default sequences can be found in /usr/share/X11/locale/<your-locale>/Compose. Also good to find out what to call your keys when writing your own sequences.

/etc/X11/xorg.conf.d/00-keyboard.conf is the file that makes the Compose key happen in X.

Section "InputClass"
    Identifier "system-keyoard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "us"
    Option "XkbModel" "acer_laptop"
    Option "XkbOptions" "compose:ralt,ctrl:nocaps"

Note that it is not recommended to edit the file above, but use localectl to edit it. I don't know why that is. To learn more about that, and all the many options available, start with


Subscribe to the comments RSS feed.

Comment #1 posted on 2022-02-21 16:20:16 by LinuxMintXFCE


Thank you very much. I've been working on learning languages with DuoLingo but the special characters I've ignored because I could not enter them easily. My notes with vim were correct because I could easily map keys. But I had no idea how to do it with linux in general without entering a bunch of keys that sometimes conflicted with the app. So all I had to do was: 1. Settings 1.1. Keyboard 1.1.1. Select Layout tab Slide off "Use system defaults" Under "Compose key" select "right alt" close everything under settings 2. vi ~/.XCompose (A file I did not have.) 2.1. Modify it as shown and save 3. Reboot the system and done! A todo might be to add special keys to do repetitive tasks...

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Anti Spam Question: What does the P in HPR stand for ?