xkbcomp doesn't work from terminal
Submitted by Yuriy Skvortsov
Assigned to Xorg Project Team
Description
Created attachment 72589 minimal keymap file in ~/.xkb/
I have a laptop with a fresh Gentoo install with X and Awesome WM without any DE / login manager. I used to login into terminal as user and startx. I also use a custom keyboard layout and apply it in ~/.xinitrc via
xkbcomp -I/home/yuriy/.xkb /home/yuriy/.xkb/mykeymap $DISPLAY
(minimal mykeymap example is attached) It works just Ok being executed from both .xinitrc and urxvt console in X. But then I've discovered that my layout settings disappear after suspend/resume. I wanted to add a hook through pm_utils but oops, it didn't work and I've started investigating. I've googled a few posts about similar problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661754 http://linux.derkeiler.com/Mailing-Lists/Fedora/2010-03/msg01620.html But this was not really helpful. When I login as same user into another terminal (outside X) and type
export DISPLAY=':0'
export XAUTHORITY='/home/yuriy/.Xauthority'
xkbcomp -I/home/yuriy/.xkb /home/yuriy/.xkb/mykeymap $DISPLAY
It executes but no changes appear to X while the same in urxvt changes the layout just as supposed. I really can not get what could be the difference between executing this in terminal and in urxvt and have no idea how to get this working. I've tested it also on another amd64 machine with Gnome and got same results.
Tested on Athlon and i7 machines with Gentoo and: xkbcomp 1.2.3, 1.2.4 xorg-server 1.11.2-r2, 1.13.1
To reproduce, login in a terminal as your X user:
mkdir ~/.xkb
cp $download_path/mykeymap ~/.xkb/mykeymap
export DISPLAY=':0' # or your display ID
export XAUTHORITY="$HOME/.Xauthority"
xkbcomp -I$HOME/.xkb $HOME/.xkb/mykeymap $DISPLAY
This SHOULD lead to change of the layout in X to the one specified in mykeymap but DOES NOT. Exactly the same executed in any terminal emulator in X (urxvt, gnome-terminal) changes the layout.
Attachment 72589, "minimal keymap file in ~/.xkb/":
mykeymap