Cyberborean Chronicles

Compose key magic

There are some amusing things in Linux which are hard to discover because they are invisible. Entering Unicode characters and sequences with a Compose key is one of those hidden features which can make user’s life much easier.

How it works

It’s simple and easy. You press and release a special key called “Compose” (or, “Multi_key”) and then, two or three character keys – a mnemonic ASCII sequence identifies a Unicode character you want to see. For example, the sequence of letter keys “o” and “c” produces the copyright symbol (©) and it is much easier to remember than Unicode 00A9.

Where is my Compose key?

There is no Compose key defined in by default. Before using it, you need to do some configuration to tell X which key you want to use as a Compose. Usually, right “Win” (“Super”) key is a good choice.

kdecompose.pngIn KDE, open “Keyboard layout” configuration panel (Control Center → Regional & Accessibility → Keyboard Layout) and select “Enable xkb options” checkbox on “Xkb options” tab. Then scroll the options list down to “Compose key position” section and select a checkbox for a key you want to use as a Compose.

Alternatively, you can edit /etc/X11/Xorg.conf (as a root) to add the line to the keyboard section:

Option "XkbOptions"  "compose:rwin"

After configuration is done, restart X (simply hit Ctrl+Alt+Backspace).

Note that you’ll need Unicode fonts installed (to see all exotic characters) and a default locale with UTF-8 support (e.g. en_US.UTF-8 for US English). This seems to be the default in modern Linux distributions.

Predefined characters

Diacritics, ligatures and currency symbols

Entering extended latin letters with diacritic marks follows the pattern:

Compose diacritic_character letter

The diacritic characters are:

  • ' (apostrophe) ⇒ A letter with acute (Áá)
  • " (double quote) ⇒ A letter with diaeresis (Ää)
  • ` (grave) ⇒ A letter with grave (Àà)
  • _ (underscore) ⇒ A letter with macron (Āā)
  • ^ (circumflex) ⇒ A letter with circumflex (Ââ)
  • ~ (tilde) ⇒ A letter with tilde (Ãã)
  • , (comma) ⇒ A letter with cedilla (Çç)
  • . (period) ⇒ A letter with dot above (Ȧȧ)
  • ! (exclamation) ⇒ A letter with dot below (Ạạ)
  • ? (question) ⇒ A letter with hook (Ảả)
  • / (slash), - (minus) ⇒ A letter with stroke (Øø, Đđ)
  • ; (semicolon) ⇒ A letter with ogonek (Ąą)
  • + (plus) ⇒ A letter with horn (Ơơ)
  • = (equals) ⇒ A letter with double acute (Őő)
  • o ⇒ A letter with ring (Åå)
  • c ⇒ A letter with caron (Ǎǎ)
  • b ⇒ A letter with breve (Ăă)

Some characters may be combined to create mixed diacritical marks, e.g. Compose _ " a produces ǟ (‘a’ with diaeresis and macron), and so on.

Other letters and ligatures:

  • Compose A/a E/e ⇒ Æ/æ
  • Compose O/o E/e ⇒ Œ/œ
  • Compose T/t H/h ⇒ Þ/þ
  • Compose N/n G/g ⇒ Ŋ/ŋ
  • Compose s s ⇒ ß
  • Compose e e ⇒ ə

Currency symbols:

  • Compose c / ⇒ ¢
  • Compose C = ⇒ €
  • Compose L = ⇒ ₤
  • Compose F r ⇒ ₣
  • Compose Y = ⇒ ¥
  • Compose o x ⇒ ¤

Punctuation marks and other symbols

Quotation marks:

  • Compose , ' ⇒ ‚
  • Compose , " ⇒ „
  • Compose < ' ⇒ ‘
  • Compose > ' ⇒ ’
  • Compose < " ⇒ “
  • Compose > " ⇒ ”
  • Compose < < ⇒ «
  • Compose > > ⇒ »
  • Compose . < ⇒ ‹
  • Compose . > ⇒ ›


  • Compose . . ⇒ ·
  • Compose - - - ⇒ — (em-dash)
  • Compose - - . ⇒ – (en-dash)
  • Compose ? ? ⇒ ¿
  • Compose ! ! ⇒ ¡
  • Compose + - ⇒ ±
  • Compose : - ⇒ ÷
  • Compose 1 2 ⇒ ½
  • Compose 1 4 ⇒ ¼
  • Compose 3 4 ⇒ ¾
  • Compose _ 0-9 ⇒ ₀ – ₉ (subscript digit)
  • Compose ^ 0-9 ⇒ ⁰ – ⁹ (superscript digit)
  • Compose ( 0-9 ) ⇒ ⓪ – ⑨ (circled digit)
  • Compose o c ⇒ ©
  • Compose o r ⇒ ®
  • Compose o o ⇒ °
  • Compose o s ⇒ §
  • Compose x x ⇒ ×
  • Compose P P ⇒ ¶
  • Compose T M ⇒ ™
  • Compose m u ⇒ µ
  • Compose % o ⇒ ‰

Defining custom Compose sequences

Default Compose sequences are defined in ‘Compose‘ text file in the current locale directory (/usr/share/X11/locale/xxx). This file contains the rules to define Compose keyboard sequences and corresponding Unicode characters:

# UTF-8 (Unicode) compose sequence
# David.Monniaux (at)
# $XFree86: xc/nls/Compose/en_US.UTF-8,v 1.11 2004/01/06 13:14:04 pascal Exp $
<Multi_key> <less> <less>        	: "«"   guillemotleft # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
<Multi_key> <greater> <greater>  	: "»"   guillemotright # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
<Multi_key> <less> <apostrophe>  	: "‘"   U2018 # LEFT SINGLE QUOTATION MARK

To define new Compose sequence, we should add another rule using the syntax:

<Multi_key> <key1> [<key2> ...]   	: "character"

For instance, for a smiley character (☺, Unicode 263A), the rule could be

<Multi_key> <colon> <parenright> : "☺"  # Compose : )

There is a number of utilities (like KCharSelect in KDE) for to select the Unicode characters and insert them into the file via clipboard.

It is possible to add new rules just into this system file (if you are root), but it’s better to create ‘.XCompose‘ file in the user home directory:

# ~/.XCompose
# This file defines custom Compose sequence for Unicode characters 

# Import default rules from the system Compose file:
include "/usr/share/X11/locale/en_US.UTF-8/Compose"

<Multi_key> <colon> <parenright> : "☺" U263A   # Compose : )
<Multi_key> <minus> <less>   : "←"  U2190 # Compose - <
<Multi_key> <minus> <greater> : "→" U2192 # Compose ->

You also can assign whole strings to the Compose sequences — for instance, syntax constructions of your favorite programming language or HTML tags:

<Multi_key> <less> <p> : "<p></p>" # Compose < p
<Multi_key> <less> <a> : "<a href=""></a>" # Compose < a

18 Responses to “Compose key magic”

  1. jetxee · January 31, 2008 at 1:44 pm · Reply

    Great! I looked for a way to easily define new Compose sequences on per-user basis. This is the solution! Thanks!

    I used to rebuild latin-plus GTK Input method extension before to implement my own compose sequences. ~/.XCompose sounds much easier.

  2. DD · February 23, 2008 at 11:07 pm · Reply

    Are you able to perform customisations in ~/.XCompose without setting GTK’s input method to “xim” (i.e. export GTK_IM_MODULE=xim)?

    I tried this, looked around, etc… and it doesn’t seem to work out.

  3. Alex · February 24, 2008 at 7:06 am · Reply

    Yeah, custom sequencies do not work in GTK apps. I don’t use a lot of them (only Firefox, etc) so noticed it after writing this post. It’s very well may be because of input method settings, thanks! I would have to learn more about GTK input stuff.

    Strangely, they work in OOffice. Does it mean it uses its own input functions, independent from GTK?

  4. daniel · March 28, 2008 at 5:10 pm · Reply

    Very good work!

    There is a solution for the GTK issue. Take a look at

    As I wrote in my comment there, you can write to /etc/X11/Xsession.d/00×11-common_set-gtk-im instead of /etc/environment, so you only have to restart X instead the whole system.

  5. ssc results 2014 · May 10, 2014 at 2:19 pm · Reply

    Actually when someone doesn’t understand after that its up to other users that they will assist, so here it happens.

  6. Arleen · August 30, 2014 at 2:20 pm · Reply

    I read a lot of interesting posts here. Probably you spend a lot of time
    writing, i know how to save you a lot of time, there is an online tool that creates
    high quality, SEO friendly articles in minutes, just search in google – laranitas free content source

  7. た-える · June 3, 2015 at 7:03 am · Reply

    Hi, I think your site might be having browser compatibility issues.
    When I look at your blog in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, excellent blog!

  8. Pedronop · January 31, 2017 at 9:15 am · Reply

    Предлагаем полностью рабочий софт/We offer cracked SIRONA CEREC PREMIUM CAM SW 4.4.3 ALL MODULES (CRACK – Dongle emulator/Custom license/Patch). Полная поддержка наших решений. Тестирование перед оплатой/Full support for our solutions. Testing before payment. Контакты/Contacts: nodongle24 /@/ (remove spaces and /)

    Dinkey 1s Dongle Emulator, скачать, Tinyhid Dongle Emulator, купить, ILok Dongle Emulator, Sentinel Scout Dongle Emulator, ROCKEY 5 Dongle Emulator, Sentinel C Plus Dongle Emulator, Hardlock Dongle Emulator, Hasp H4 Dongle Emulator, Guardant Aptus Dongle Emulator, Spark Keypro Dongle Emulator, Megalock Korea Dongle Emulator, Spark Keypro Dongle Emulator, Keylock 3 Dongle Emulator.

  9. GregoryJam · February 6, 2017 at 10:27 pm · Reply
  10. Svetakrsvca · August 16, 2017 at 3:53 am · Reply

    Не поймите превратно, если не по теме, но это важно для меня.
    Встречала сообщение тут человек искал где диплом купить – поделитесь информацией , если нашли.
    Напишите мне в лс или на почту, тоже сильно нужно купить диплом и срочно !

  11. FirstCaridad · November 21, 2017 at 10:43 am · Reply

    I have noticed you don’t monetize your website, don’t waste your traffic, you can earn additional cash every month because you’ve got hi quality content.

    If you want to know how to make extra $$$, search for:
    Boorfe’s tips best adsense alternative

  12. Kennethactic · January 11, 2018 at 10:51 am · Reply

    Занятие за морем: причины и перспективы
    Во наши дни для работодателя не так главен документ, некоторый свидетельствует о приобретенном образовании, же теоретические да практические навыки, что У вас появилась возможность купить в процессе учебы. К сожалению, ВУЗы во нашей огромной стране как правило никак не способны ударить эти багаж да искусства, который просит настоящий работник базар. Оттого из года в год всё больше и больше юношей осуществляют разбор в пользу учебы за рубежом. Но пред ними постает положение о том, какую страну и факультет избрать, какой-никакие програмки обучения особенно легкодоступны да какие перспективы трудоустройства после окончанию учебы.
    По данным статистики, среди самых известных английских стран про учебы, США – занимает первое место. Ведь Сша – уругвай великих возможностей, же южноамериканские дипломы ценятся во всем мире.
    Какой-никакие занятие в США обладает выдающиеся качества?
    Один. Здесь отыскиваются наилучшие институты мира, оттого высшее устройство во Америке занимает фаворитные позиции;
    Два. Большой указатель предлагаемых квалификаций. Вы имеете право приобрести ту профессию о которой грезите да стать специалистом в своей поле деятельности;
    3. В учебном процессе коренной уклон идёт в практику. Тренировочные програмки формируются исходя из требований компаний, что бедствуют во обученных рабочих кадрах;
    Четыре. Новые схемы да просторная экспериментальная основа являются неотъемлемой частично учебы в американском Институте;
    5. Получая образование в Америка, Вы получаете право подбора. В Вашем распоряжении ведь, какой-никакие курсы, в каком семестре и какое сумма времен нужно сделать акцент в их изучение. Такая конструкция разрешает построить удобный график да обучает студента самостоятельности;
    6. Опыт жизни в кампусе экстремально соотнести со чем-либо еще. Кампос – сие комфортное место для проживания да учёбы, приятные соседи из различных государств решетка, различные спортивные постройки и площадки, рестораны, клубы и еще многое ради чего стоит получать образование в Америка.

Leave a Reply