Esperanto Characters in Linux
If you want something you’ve never had, you must be willing to do something you’ve never done.
—Thomas Jefferson
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:
Character | Sequence |
---|---|
ĉ | 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.