Esperanto Characters in Linux

Esperanto • English
Last updated: March 17, 2022

If you want something you’ve never had, you must be willing to do something you’ve never done.
—Thomas Jefferson

stefan-HbwYKfnVz0-unsplash

Table of contents

Introduction

I opine, that one should no longer be using the h- or x-system to input the characters specific to Esperanto, unless it is not physically possible. Currently, there are two ways to input Esperanto characters on Linux systems—the Multi‎ߺ‎key and Mode‎ߺ‎switch keys.

In this article the 🐧 key signifies the Mode‎ߺ‎switch key.

Multi‎ߺ‎key

The Multi‎ߺ‎key, also called the 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 using 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 for the Esperanto characters:

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 windows key
keycode 133 = Mode‎ߺ‎switch

!! right windows key
keycode 134 = Mode‎ߺ‎switch

!! menu key
keycode 135 = Mode‎ߺ‎switch

Next, you need to add the appropriate names for the corresponding Esperanto characters. Use the following snippets for QWERTY kaj Dvorak keyboards, respectively.

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

To input ĉ, press and hold 🐧, then press c. To input Ŭ, press and hold 🐧, press and hold Shift, then press and release u. This setup effectively allows you to touch type.

On some keyboards, only one Windows key 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 the Ctrl and Alt keys. 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

Closing remarks

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

Male al tio, the advantage of the Mode‎ߺ‎switch method is speed. To see the list of character names available, click here.

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.