LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 07-19-2009, 06:13 PM   #1
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,953

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
Compose sequences


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 )
 
Old 07-20-2009, 11:13 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Try to add the following line in /etc/X11/xorg.conf in the keyboard (input device) section:
Code:
Option          "XkbOptions"    "compose:rwin"
then restart the X server. It enables the Right Windows key as the compose key.

PS: you can enable it also from the system menu: System -> Preferences -> Keyboard -> Layout Options -> Compose key position.

Last edited by colucix; 07-20-2009 at 11:16 AM. Reason: added info on GUI shortcut
 
Old 07-21-2009, 04:17 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,953

Original Poster
Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
Oh, dear

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.
 
Old 07-22-2009, 07:19 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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 : )
Hope this helps, now.
 
Old 07-23-2009, 12:21 PM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,953

Original Poster
Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
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
 
Old 07-24-2009, 02:17 AM   #6
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Quote:
Originally Posted by DavidMcCann View Post
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).
 
Old 07-25-2009, 12:22 PM   #7
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,953

Original Poster
Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
Thanks for the link. The problems seem to be

1. Setting the environment variable is no longer working in Fedora, though it used to, and still does in Ubuntu. I shall try reporting that as a bug.

2. The Gnome people insist on hard-wiring something which ought to be configurable, and duplicating something that is already there.
 
Old 07-25-2009, 03:35 PM   #8
Escher
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 1
In Fedora you need to set GTK_IM_MODULE=xim in /etc/X11/xinit/xinput.d/none.conf, you also need to install the gtk2-immodule-xim package

Last edited by Escher; 07-25-2009 at 03:36 PM.
 
Old 07-25-2009, 03:38 PM   #9
Escher
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 1
solution from here:

http://forums.fedoraforum.org/showthread.php?t=226805
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
escape sequences in enscript lanco Linux - Newbie 1 03-01-2009 02:32 PM
echo out CTRL- sequences how to? jamesps Linux - General 0 07-22-2005 04:16 PM
Analyzing Protein Sequences Lostlucidty Linux - Software 7 05-24-2005 10:14 AM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 11:37 AM
Xterm escape sequences GrayGh0st Linux - Software 3 07-19-2003 12:10 AM


All times are GMT -5. The time now is 06:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration