Esperanto Characters in Linux

April 18, 2016
Updated: May 13, 2016

Prior to the invention of the methods discussed in this post, the way to input Esperanto characters on Linux is to use the the h- or x-systems. To input the character ĉ, you would have to write “ch” or “cx”. The latter was more preferred because the character x isn’t part of the Esperanto alphabet. Another, more tedious way of inputting characters was with the use of a character map—a GUI application that displays Unicode characters, that you can copy characters from. A popular character map application for Linux systems is gucharmap.

The aforementioned systems are inaccurate, and tedious. There’s no need to continue using these input methods, aside from supporting legacy display systems. Currently, there are two ways to input Esperanto characters on Linux systems—the multi key and mode switch.

Table of contents

Multi key

The multi key, also called a compose key, is a specially-assigned key, that must be pressed and released, along with other keys, to input a character, or series of characters. Unlike Shift or Ctrl, it must be released, and not held down.

To use the Pause key as the multi key, edit the file ~/.Xmodmap, then add the following:

keycode 127 = Multi_key

Then, re-read ~/.Xmodmap:

$ xmodmap ~/.Xmodmap

If you do not want to use Pause as the multi key, run xev:

$ xev

A small window appears with a white background. Move your mouse inside the window, then press a key on your keyboard. On your terminal, you will see the keycode of the key that you pressed.

…
KeyRelease event, serial 36, synthetic NO, window 0x2e00001,
    root 0x299, subw 0x0, time 131237513, (16,285), root:(978,647),
    state 0x0, keycode 107 (keysym 0xff61, Print), same_screen YES,
               ^^^^^^^^^^^
…

So, to use the Print key as your multi key, edit ~/.Xmodmap to contain:

keycode 107 = Multi_key

Then re-read the ~/.Xmodmap file as described above.

Now that you have access to the multi key, composing characters will be easy. Presuming you’re Pause as the multi key, to input ĉ, you must press and release Pause, press and release ^ (shift 6), then finally, press and release c.

The following table lists the combinations:

CharacterSequence
ĉMulti_key ^ c
ĈMulti_key ^ C
ĝMulti_key ^ g
ĜMulti_key ^ G
ĥMulti_key ^ h
ĤMulti_key ^ H
ĵMulti_key ^ j
ĴMulti_key ^ J
ŝMulti_key ^ s
ŜMulti_key ^ S
ŭMulti_key u u
ŬMulti_key U U

Mode switch

A faster and easier way to input Esperanto characters is through the use of the mode switch key. Just like with the multi key, you assign a key to it. I like to bind two keys to it, so I can type with both hands. Unlike the multi key, you have to hold it down like the Shift or Ctrl keys.

If you want to assign the Windows keys as the mode switch keys, edit the file ~/.Xmodmap, then add the following:

!! Left Window
keycode 133 = Mode_switch

!! Right Window
keycode 134 = Mode_switch

Next, you need to add the appropriate names for the corresponding Esperanto characters. If you’re using QWERTY, add the following to your ~/.Xmodmap.

keycode 54 = c C ccircumflex Ccircumflex
keycode 42 = g G gcircumflex Gcircumflex
keycode 43 = h h hcircumflex Hcircumflex
keycode 44 = j J jcircumflex Jcircumflex
keycode 39 = s S scircumflex Scircumflex
keycode 30 = u U ubreve Ubreve

And if you’re using Dvorak, use the following:

keycode 31 = c C ccircumflex Ccircumflex
keycode 30 = g G gcircumflex Gcircumflex
keycode 44 = h h hcircumflex Hcircumflex
keycode 54 = j J jcircumflex Jcircumflex
keycode 47 = s S scircumflex Scircumflex
keycode 41 = u U ubreve Ubreve

Then, re-read ~/.Xmodmap:

$ xmodmap ~/.Xmodmap

Using the Windows keys as mode switch keys, to input ĉ, press and hold Windows, then press c. To input Ŭ, press and , press and hold Shift, then press u. This setup effectively allows you to touch type. On some keyboards, only one Windows is present—usually located on the left side, while the one on the right can be PrtSc. A lot of times, they’re sandwiched between Ctrl and Alt. To use that key, run xev like above, to get the keycode, and update your ~/.Xmodmap, accordingly. On my ThinkPad, my ~/.Xmodmap has this:

!! Left Window
keycode 133 = Mode_switch

!! PrtSc
keycode 107 = Mode_switch

Additional notes

Both methods outlined above do far more than emitting Esperanto characters. The multi key system can emit more sophisticated symbols and characters. To see the complete list of characters, run the following command if you’re on mainstream Linux systems:

$ less /usr/share/X11/locale/en_US.UTF-8/Compose

If you’re using Nix, run:

$ less ~/.nix-profile/share/X11/locale/en_US.UTF-8/Compose

The mode switch system, albeit, not as extensive as the former, is also a bit comprehensive. To see the list of character names available, click here.

Closing remarks

There’s no best way to do this—use whatever system that fits your style. If you’re already using the Windows keys for something else, and you can only use one “spare” key on your keyboard, then use the multi key method. If you want ease of use, use the mode switch method. It is important to note, too, that you can use both methods simultaneously.

Ĝis la revido! (/^▽^)/