On Thu, Oct 24, 2002 at 12:13:44 +0100, John Keniry wrote:
> On Thu, Oct 24, 2002 at 02:20:32AM +0200, Vincent Lefevre wrote:
> > #! /bin/sh
> > PATH=$HOME/bin:$PATH
> > failsafe="xterm -ls -T Failsafe -geometry 80x24-0-0"
> > trap "exec $failsafe" EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO
> > 
> > [some commands]
> 
> This is where you put your xmodmap command right?

Yes.

> Thanks for that. I know a little more now, but I'm still puzzled as to how
> this is (not) working. I know that if I create an .xinitrc then I must
> "do what Xsessions does" or my WM won't start, yet if I include the
> xmodmap before all that in the script it has no effect. My .xinitrc:
> 
> $cat .xinitrc
> #!/bin/sh
> 
> [ -e $HOME/.Xmodmap ] && xmodmap $HOME/.Xmodmap
> 
> # invoke global X session script
> /etc/X11/Xsession

I don't use Xsession files. But you need to make sure that the above
xmodmap settings are not overridden by a xmodmap call in an Xsession
file.

Also, before calling xmodmap, the DISPLAY variable needs to be set (in
case it is not set properly). I have:

if [ -z "$DISPLAY" ]; then
  DISPLAY=":0"
fi

# Local display: :0 should be used as the most efficient local transport
# will be chosen (see man X).
case $DISPLAY in
  unix:0.0|unix:0|:0.0|:0) DISPLAY=":0";;
esac

> Now I startx and try pressing the key I want to xmodmap to change, and
> find the key is unaltered. If I cut and paste the whole xmodmap line
> above into a terminal and run it then try the key again the new mapping
> is applied as it should be. So it didn't work in the script.
> 
> It makes no difference if I reverse the order in the .xinitrc script,
> i.e. invoke Xsession first - the keymap is still unaltered when X
> starts.

I don't know how it works exactly, but I suppose that if Xsession
starts the window manager and you put the xmodmap after the call to
Xsession, the xmodmap won't be executed as expected.

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to