Jorge Almeida
2011-10-01 09:49:46 UTC
I have a very annoying problem with xmodmap:
Inside X, in an xterm:
$ echo $DISPLAY
:1
In console (agetty1):
$ echo $DISPLAY
$ xmodmap .Xmodmap
xmodmap: unable to open display ''
$ xmodmap -display :2 .Xmodmap
xmodmap: unable to open display ':2'
Until now, everything as expected. The problem is:
$ xmodmap -display :1 .Xmodmap
$ echo $?
0
So, everything seems fine, but switching to the vt where X is I find
that xmodmap didn't load anything. Note that if running "xmodmap
.Xmodmap" from X it works. In console, I tried also setting the env
variable DISPLAY (the only one relevant to xmodmap, according to the
manual), to no avail.
You might wonder why is this a problem, since it works from X. I have
a xmodmap command in the startup file of the window manager (openbox).
Other X related commands work, only xmodmap fails. It seems that
xmodmap requires being run from an emulator inside an X session, which
it's not supposed to.
Any help about this essentially undocumented piece of software would
be appreciated. Alternatively, anyone knows whether there is some
alternative to xmodmap? xkb doesn't seem to be able to replace it,
judging by what poor documentation there is out there.
TIA
Jorge Almeida
Inside X, in an xterm:
$ echo $DISPLAY
:1
In console (agetty1):
$ echo $DISPLAY
$ xmodmap .Xmodmap
xmodmap: unable to open display ''
$ xmodmap -display :2 .Xmodmap
xmodmap: unable to open display ':2'
Until now, everything as expected. The problem is:
$ xmodmap -display :1 .Xmodmap
$ echo $?
0
So, everything seems fine, but switching to the vt where X is I find
that xmodmap didn't load anything. Note that if running "xmodmap
.Xmodmap" from X it works. In console, I tried also setting the env
variable DISPLAY (the only one relevant to xmodmap, according to the
manual), to no avail.
You might wonder why is this a problem, since it works from X. I have
a xmodmap command in the startup file of the window manager (openbox).
Other X related commands work, only xmodmap fails. It seems that
xmodmap requires being run from an emulator inside an X session, which
it's not supposed to.
Any help about this essentially undocumented piece of software would
be appreciated. Alternatively, anyone knows whether there is some
alternative to xmodmap? xkb doesn't seem to be able to replace it,
judging by what poor documentation there is out there.
TIA
Jorge Almeida