defining compose sequences

This is a discussion on defining compose sequences within the X forums, part of the Help category; In SuSE 9.1 : /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose defines compose sequences for many unicode characters. I need a few more. Where can I define an extension to this or replace it with a ...

Go Back   Unix Linux Forum > Unix > Linux > Help > X

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-30-2007, 08:32 PM
Default defining compose sequences

In SuSE 9.1 : /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose

defines compose sequences for many unicode characters. I need a few
more. Where can I define an extension to this or replace it with a
personal version?
Reply With Quote
  #2  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences

David Sudlow wrote:
>In SuSE 9.1 : /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose
>
>defines compose sequences for many unicode characters. I need a few
>more. Where can I define an extension to this or replace it with a
>personal version?


As usual, there is an environment variable to do this.

XLOCALEDIR should be set to a colon-separated list of directories
that are in the format of /usr/X11R6/lib/X11/locale/ -- that is, they
should contain the file compose.dir that can be used to find the
actual Compose file based on the full locale name.

Reply With Quote
  #3  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences


"Kip Rugger" wrote in message
news:cd19m0$8v$1@rugger.nodomain.ca...
> David Sudlow wrote:
> >In SuSE 9.1 : /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose
> >
> >defines compose sequences for many unicode characters. I need a few
> >more. Where can I define an extension to this or replace it with a
> >personal version?

>
> As usual, there is an environment variable to do this.
>
> XLOCALEDIR should be set to a colon-separated list of directories
> that are in the format of /usr/X11R6/lib/X11/locale/ -- that is, they
> should contain the file compose.dir that can be used to find the
> actual Compose file based on the full locale name.
>


Great. I can see how that works. In which configuration file should I set it
so it applies to the whole X session not just to Bash sessions I open? i.e.
so that it applies to programs started from the KDE menu as well as those
started from an Xterm.

Dave


Reply With Quote
  #4  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences

Dave wrote:
>
>"Kip Rugger" wrote in message
>>
>> XLOCALEDIR should be set to a colon-separated list of directories
>> that are in the format of /usr/X11R6/lib/X11/locale/ -- that is, they
>> should contain the file compose.dir that can be used to find the
>> actual Compose file based on the full locale name.
>>

>
>Great. I can see how that works. In which configuration file should I set it
>so it applies to the whole X session not just to Bash sessions I open? i.e.
>so that it applies to programs started from the KDE menu as well as those
>started from an Xterm.


In the good old days, before msification of the desktop, you would simply
do this in your ~/.xsession file. Nowadays, this seems to depend on the
whims of the distro you are using. For the Debian system I am on, the
following seems needed.

edit /etc/X11/Xsession.options to include the line "allow-user-xsession"
create ~/.xsession with the line "exec /usr/bin/x-session-manager"
chmod ~/.xsession to be executable

This should be an effective nop, but it is probably worth testing.
Remember the errors wind up in ~/.xsession-errors.

Then you can replace the ~/.xsession file with something like

a=~/.locale
b=en_US.UTF-8
c=/usr/X11R6/lib/X11/locale
mkdir $a
echo Compose $b >$a/compose.dir
cat $c/$b/Compose - <$a/Compose
# absolute junk as additions
: "x"
: "y"
EOF
eval export XLOCALEDIR=$a:$c

exec /usr/bin/x-session-manager

  #5  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences

Kip Rugger wrote:
> Dave wrote:
>
>>"Kip Rugger" wrote in message
>>
>>>XLOCALEDIR should be set to a colon-separated list of directories
>>>that are in the format of /usr/X11R6/lib/X11/locale/ -- that is, they
>>>should contain the file compose.dir that can be used to find the
>>>actual Compose file based on the full locale name.
>>>

>>
>>Great. I can see how that works. In which configuration file should I set it
>>so it applies to the whole X session not just to Bash sessions I open? i.e.
>>so that it applies to programs started from the KDE menu as well as those
>>started from an Xterm.

>
>
> In the good old days, before msification of the desktop, you would simply
> do this in your ~/.xsession file. Nowadays, this seems to depend on the
> whims of the distro you are using. For the Debian system I am on, the
> following seems needed.
>
> edit /etc/X11/Xsession.options to include the line "allow-user-xsession"
> create ~/.xsession with the line "exec /usr/bin/x-session-manager"
> chmod ~/.xsession to be executable
>
> This should be an effective nop, but it is probably worth testing.
> Remember the errors wind up in ~/.xsession-errors.
>
> Then you can replace the ~/.xsession file with something like
>
> a=~/.locale
> b=en_US.UTF-8
> c=/usr/X11R6/lib/X11/locale
> mkdir $a
> echo Compose $b >$a/compose.dir
> cat $c/$b/Compose - <$a/Compose
> # absolute junk as additions
> : "x"
>
: "y"
> EOF
> eval export XLOCALEDIR=$a:$c
>
> exec /usr/bin/x-session-manager
>


Hmm. I'm having trouble. I created a folder ~/.locale, added a file
compose.dir with the single line:
Compose en_US.UTF-8

then I created a file Compose with the single (test) line:
: "h"

then I did
a=~/.locale
export XLOCALEDIR=$a

(Note that before I did this XLOCALEDIR did not exist).

then vi
but the original sequences are still there and my new one is not. When
is XLOCALEDIR accessed? Only when X starts perhaps?

On SuSE 9.1 there is no /etc/X11/Xsession.options file. Should I create
one or is a different 'system' in use?

  #6  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences

David Sudlow wrote:
>Hmm. I'm having trouble. I created a folder ~/.locale, added a file
>compose.dir with the single line:
>Compose en_US.UTF-8


Looking carefully at compose.dir (and the other .dir files), there
seems to be a transitional convention to build the files without and
with a colon separator

Compose en_US.UTF-8

Compose: en_US.UTF-8


>then I created a file Compose with the single (test) line:
> : "h"
>
>then I did
>a=~/.locale
>export XLOCALEDIR=$a


Careful here. This sets XLOCALEDIR to ~/.locale, ie the tilde
expansion has not been done. A common idiom is to always use "eval
export ..." to get double substitution. It matters.

>(Note that before I did this XLOCALEDIR did not exist).
>
>then vi
>but the original sequences are still there and my new one is not. When
>is XLOCALEDIR accessed? Only when X starts perhaps?


It is accessed when the app starts. Which is why you can do things
like XLOCALEDIR=... vi ...

However, it is accessed by X apps (Xlib really) and vi is no X app
(unless you really mean xvile or equivalent). So you would apply the
XLOCALEDIR to an xterm...

>On SuSE 9.1 there is no /etc/X11/Xsession.options file. Should I create
>one or is a different 'system' in use?


I have no idea, since I don't use SuSE. Try creating a .xsession file
and see if it gets processed. If not, well, start at
/etc/kde2/kdm/Xsession and see how the session gets built.


I actually tried all this, using (x)emacs as a test program and using
strace to see what was being read -- it really does work (if you
ignore the damage that it does to the keyboard .

Reply With Quote
  #7  
Old 09-30-2007, 08:32 PM
Default Re: defining compose sequences

Kip Rugger wrote:
> David Sudlow wrote:
>
>>Hmm. I'm having trouble. I created a folder ~/.locale, added a file
>>compose.dir with the single line:
>>Compose en_US.UTF-8

>
>
> Looking carefully at compose.dir (and the other .dir files), there
> seems to be a transitional convention to build the files without and
> with a colon separator
>
> Compose en_US.UTF-8
>
> Compose: en_US.UTF-8
>
>
>>then I created a file Compose with the single (test) line:
>> : "h"
>>
>>then I did
>>a=~/.locale
>>export XLOCALEDIR=$a

>
>
> Careful here. This sets XLOCALEDIR to ~/.locale, ie the tilde
> expansion has not been done. A common idiom is to always use "eval
> export ..." to get double substitution. It matters.
>
>
>>(Note that before I did this XLOCALEDIR did not exist).
>>
>>then vi
>>but the original sequences are still there and my new one is not. When
>>is XLOCALEDIR accessed? Only when X starts perhaps?

>
>
> It is accessed when the app starts. Which is why you can do things
> like XLOCALEDIR=... vi ...
>
> However, it is accessed by X apps (Xlib really) and vi is no X app
> (unless you really mean xvile or equivalent). So you would apply the
> XLOCALEDIR to an xterm...
>
>
>>On SuSE 9.1 there is no /etc/X11/Xsession.options file. Should I create
>>one or is a different 'system' in use?

>
>
> I have no idea, since I don't use SuSE. Try creating a .xsession file
> and see if it gets processed. If not, well, start at
> /etc/kde2/kdm/Xsession and see how the session gets built.
>
>
> I actually tried all this, using (x)emacs as a test program and using
> strace to see what was being read -- it really does work (if you
> ignore the damage that it does to the keyboard .
>

Thanks. I've now got it working.

I don't seem to get a colon seperated list processed but I have copied
the file and added my own entries. (In fact I only seem to need four as
so many unicode places are covered in the basic file).

My
~/.xsession
is:
export XLOCALEDIR=/home/dave/.locale
exec /usr/X11R6/lib/X11/xdm/sys.xsession

I found that path though looking at
/etc/X11/xdm/Xsession
which is the script that looks to see if ~/.xsession exists and calls it.

Thanks for your help

Dave

PS
I found the reference to /etc/X11/xdm/Xsession looking through:
/etc/opt/kde3/share/config/kdm/kdmrc
based on your suggestion to look for:
/etc/kde2/kdm/Xsession

these things keep moving it seems
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 11:56 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger