Wisdom of the Ancients

If you use US International keyboard on Linux, you know the royal pain of having to press space after the compose character (typically '). Contractions like can't, won't, Mary's, etc are a struggle, as you have to press space after ', otherwise you'll get canť, wonť, Maryś, etc.

It's even more painful if you ever used Windows, as its US Intl Keyboard works fine out of the box. It's a shame that Linux keyboard is horribly "broken" (some may say it's by design; no, it's not).

It has been asked before, but most answers will point you to use xim, which will open another can of worms. You'll end up in a rabbit hole of Chrome bugs and intrincated workarounds to make Sublime work (spoiler: it won't). Before you realize, the weekend is gone.

After spending a lot of time troubleshooting, I got to a deceptively simple arrangement, allowing .XCompose customizations on GTK+, QT, Aura (Chromium), and even on plain terminal:

Just use uim.

Get rid of the default iBus, xim and everything else, and just go with uim.

Of course, YMMV. I'm running Ubuntu 14.04 with Gnome 3.12.1, and using Chrome v38.0.2125.66 beta, and Sublime Text 3 build 3064.

This also has the added benefit of allowing Unicode characters using Ctrl+Shift+U.

Note that Sublime overrides the default keybinding for Ctrl+Shift+U with soft_redo (source ). You have two options here: 1) edit the default keybinding file - which is not recommended, as it'll be overwritten on your next upgrade, or 2) use Ctrl+Shift+Alt+U. I've chosen the latter.

Detailed instructions:

  1. Install uim with sudo apt-get install uim
  2. Check which inputs you have installed with im-config -l. Remove everything except for uim and xim (optional, but recommended)
  3. Set default input to uim, using im-config -n uim
  4. On System Config, Keyboard, select "US, intl with dead keys"
  5. On System Config, Language Support, confirm you have uim under Keyboard input method system. If you removed the other input systems, you should have only uim/none here
  6. Add the following lines to /etc/environment:

    xmodmap -e 'keycode 48 = dead_acute dead_diaeresis dead_acute dead_diaeresis acute diaeresis'
  7. Get this .XCompose file and put on your home directory, using wget ~
  8. Log out, log back in and enjoy!

Don't forget to say thanks to @tamh, who did all the hard work to map the correct keys on the .XCompose.

comments powered by Disqus
Blog Logo

Gui Ambros

Maker, engineer, ad:tech veteran. Incurable optimist. I was there when the web was born. Opinions here are my own. @GuiAmbros



/dev/random rants about technology, electronics, startups.

Back to Overview