Re: xmodmap again - not solved after all
On 09/25/2007 09:25 AM, Anthony Campbell wrote:
I've twice thought I'd solved this one but no. To recap: my .xinitrc
contains the line: "xmodmap ~/.Xmodmap". which has worked for many
months or even years. In the last couple of weeks the command is not
being run.
I tried putting the full path to xmodmap, which seemed to work at first
but then failed. Next, I put the command in ~/.bashrc. That does work
but it has the undesirable effect of making bash try to run xmodmap even
when X is not running. The result was that pinging and ssh between
computers on my network kept failing.
Try this in your .bashrc:
if [ -n "$DISPLAY" ]; then
if (which xmodmap); then
xmodmap ~/.Xmodmap
fi
fi > /dev/null
So at present I'm stuck, unless I can find something in the bash man
page to cater for the issue (perhaps a conditional clause in .bashrc?).
Meawhile I think I'll put a bug report in for xinit.
What version of xinit? What O/S are you using?
Has no one else seen this behaviour? (I think someone on the Slacware
newsgroup has.)
Anthony
I've never seen it, but I don't assume that xmodmap will automatically
be called.
Note, the code I wrote has a problem. You need to find a way to test
that xmodmap hasn't already been invoked for the X server. To do this,
you might test if your key mappings are already in xmodmap before
invoking it.
BTW, is it possible to store a semaphore on the X server? I'm thinking
that xrdb could be used like so:
echo 'sem*xmodmap_done: yes' | xrdb -merge
But perhaps there are other ways.
Reply to: