Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In /usr/share/X11/locale/en_US.UTF-8 is the Compose file for English. It lists the Compose key sequences, and the permitted uses for dead and combining keys. It used to be possible to customise it, which was very useful for linguists or mathematicians. Now altering it or even removing it has no effect. So where are the sequences being obtained? This is presumably a Gnome thing, but a post at Gnome support has obtained no answer. Can anyone shed any light on this? (Or even on why one can never find any documentation about Gnome )
I didn't ask how to enable a compose key. Please read the question before asking it: if you answer the wrong question, it removes the thread from the zero-replies category and so reduces the chance of it ever getting answered.
Sorry, that was not my intention... errare humanum est.
To activate your custom compose sequence you have to define an environment variable:
Code:
export GTK_IM_MODULE=xim
if using Gnome, whereas using KDE it should be QT_IM_MODULE=xim. There are different opinions on where to put such definition, however it works if you put it in your own ~/.bashrc. After that, restart the X server and the changes in /usr/share/X11/locale/en_US.UTF-8/Compose should take effect.
If you want to leave the system file unchanged, you can create the file ~/.XCompose and include /usr/share/X11/locale/en_US.UTF-8/Compose together with your custom sequences. For example:
Code:
# This file defines custom Compose sequence for Unicode characters
# Import default rules from the system Compose file:
include "/usr/share/X11/locale/en_US.UTF-8/Compose"
<Multi_key> <colon> <parenright> : "☺" # Compose : )
I already have GTK_IM_MODULE=xim in /etc/environment, and "echo $GTK_IM_MODULE" shows that it's set. Without this, some compose sequences work, some don't.
As I said, the problem here is that a set of definitions identical to the one in the default file is being obtained from somewhere other than the default file, and I can't trace the source. I suspect that it must be compiled-in somewhere, completely negating the whole Linux idea of having configuration files accessible to the user.
Further research shows that the problem is that, despite setting the environment variable, xim is not working, and GTK then falls back on a hard-wired default of an old US compose sequence. The cure is another question.
Last edited by DavidMcCann; 07-23-2009 at 05:34 PM.
Reason: Addition
Further research shows that the problem is that, despite setting the environment variable, xim is not working, and GTK then falls back on a hard-wired default of an old US compose sequence. The cure is another question.
Googlin' around I found that X input method is different from GTK+ input method, which is the default. I wouldn't tell it's not working, it just works in a different way, with different compose sequences. Furthermore it does not accept unicode sequences, those obtained by Ctrl-Shift-U + code.
Here is a little explanation about input methods, with some other interesting links. It's hard to find information about the inner mechanism involved in compose sequences. Indeed, it looks like it is hard-coded in the GTK2 library. I tried to grep GTK_IM_MODULE and the unique result is libgtk-x11-2.0.so.0.1000.4 which is provided by gtk2-2.10.4-20.el5 (this is CentOS 5.3).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.