6

Entering raw Unicode characters by first hitting Ctrl+Shift+u and then entering the hex value of a code point to get that character (e.g. 262D for ☭) is quite useful, esp. when you're testing typesetting in assorted languages you can't type and need to pull something out of a language's table.

On the other hand so is setting up custom compose sequences that make sense so you don't have to remember the hex value for frequently used characters. For example I have this in my ~/.Xcompose file:

include "%L"
<Multi_key> <t> <l> : "₺" U20BA

This makes it really easy to get the Turkish Lira sign.

The trouble is that this method of setting up compose sequences only seems to work with the XIM input module (from my ~/.xprofile):

export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim

Of course XIM doesn't support the Unicode entry system above. So it seems to be either or: I can have one or the other if I settle on the useful one before I login to my X session, but once chosen I can't change it.

How can I get the best of both worlds? In there an input module that handles both?

2

Uim

First released in 2005, uim is a multilingual input method library with interfaces to GTK and QT, as well as anything that supports xim (and more). Looking at computers I have nearby, Arch Linux, NetBSD, and Ubuntu all offer uim packages through their default distribution channels, which (to me) indicates some measure of acceptance in the community at large.

An excerpt from my .xprofile shows how to set this up:

export GTK_IM_MODULE='uim'
export QT_IM_MODULE='uim'
uim-xim &
export XMODIFIERS='@im=uim'
# Start one of the input method switchers
uim-toolbar-gtk-systray &
  • What UIM input method do you use to enter Unicode characters by their code point? – Caleb Jul 30 '16 at 9:06
  • I'm using Anthy (UTF-8), since I often type in Japanese. – Fox Jul 30 '16 at 9:36
  • Anthy just confuses the issue to me as I'm not looking for other language input, but m17n-unicode seems to be a basic module for entering hex sequences. – Caleb Jul 30 '16 at 10:21
1

With xte that comes with the xautomation package it is possible to send keypresses to X. The package name may differ between Linux distros.

This command will type a ☭:

xte 'keydown Shift_L' 'keydown Control_L' 'str u262d' 'keyup Control_L' 'keyup Shift_L'

By setting up a keybinding in your windowmanager for a similar xte command for the lira symbol, you should be able to achieve the desired effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.