defining compose sequences - X

This is a discussion on defining compose sequences - X ; 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 to Thread
Results 1 to 7 of 7

Thread: defining compose sequences

  1. 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?

  2. 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.


  3. 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



  4. 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. 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. 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 .


  7. 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