Saturday, June 29, 2013

Type non-English characters easily on Linux or any X-windows system!

The following works extremely well and does not break anything for typical users of English-language keyboards.

You have to edit the ~/.Xmodmap (traditional name, any  file name is okay) then do this in your init (.bashrc or .profile):
xmodmap ~/.Xmodmap

You are telling the xmodmap program to load custom keystrokes for this login session.

Below  is the edit to get a Compose key that enables most Unicode characters such as the í in my name or the the â in the French château.  I once broke the â in a Digital Equipment product, and you hear from the French, immédiatement if you do that!  To get that â, you hold down a special key call Compose, (like a shift key) type the a, which does not show immediately, and follow it with the ^ key.  This works for any vowel. Other sequences are similarly obvious. Just try it until it works for you.
Type Compose-i' to get the í in my name.

keycode 133 =  Multi_key

That's the entire content of my .Xmodmap.  It turns the Windows key into the Compose key.  Works for just about any well-behaved program, LibreOffice, browsers, etc.

This is a universal (any X-windows system) solution.

I find this super useful because it gets you French and Spanish, German, and most European languages  with no fooling around.  Asian and Aramaic languages are harder to do and having a dedicated keyboard would be the best thing.  Experts in a language might be able to manage with an English keyboard, but not me.

See this page for a readable, if simplistic, tutorial:
I just found that via Google.

The official technical docs make this look really hard.  It's not hard!

Thanks to Aron Insinga, who inspired me to write the first draft of this.  Anyone: please correct me if I'm wrong about some detail or failed to explain something well enough.

I once had all 14 Digital Equipment Co. keyboards in my office there.

Anyone: Please correct me if I got something work or failed to explain something well enough.

No comments:

Post a Comment