compose key in FVWM

The compose key can be used to input any character that your font is able to display. As examples:

“compose + , (comma) + c” = ç
“compose + , (comma) + shift c” = Ç
“compose + o + a” = å

It was time consuming for me to found the correct way to configure it so that it work with the console, the X applications and QT + GTK+ applications. As I found nothing here about this issue, here is what I done.

I am using fr_CH.UTF-8 for my user’s locales and a gentoo system.

XOrg config : /etc/X11/xorg.conf

Section "InputDevice" Driver "keyboard" Identifier "Keyboard[0]" Option "Protocol" "Standard" Option "XkbLayout" "ch" Option "XkbRules" "xorg" Option "XkbVariant" "fr" Option "XkbModel" "pc105" Option "XkbOptions" "compose:rwin" EndSection
The most important here is the XkbOptions line. It use the right windows key on my keyboard. To find a valid key for your keyboard, look for “Compose key” in /usr/share/X11/xkb/rules/xorg.lst. It is one of ralt, lwin, rwin, menu, rctrl or caps at that time of writing.

After restarting the X server, compose must work into the console and the X applications.

Custom key combinations
I also copied over /usr/share/X11/locale/en_US.UTF-8/Compose to ~/.XCompose

That way, it is easy to add custom key combinations. It is just to add them at the beginning of ~/.XCompose. As example :

<Multi_key> <minus> <o> : "Θ"

QT (KDE) and GTK+ (Gnome) applications
For the QT and GTK+ applications, create or edit ~/.xprofile and add :

export GTK_IM_MODULE=xim export QT_IM_MODULE=xim