You are not logged in.

#1 2013-02-08 23:56:45

cprussin
Member
Registered: 2010-07-20
Posts: 9

setxkbmap not working when called from outside X session with $DISPLAY

Hi all-

While investigating a problem I'm trying to fix, I noticed that setxkbmap does not properly set the keyboard map on a display from a TTY (and possibly a different display if multiple are running), even if $DISPLAY has been defined properly or the -display option is used.  There are no errors and setxkbmap seems to think that the keymap actually does switch, but it doesn't.  For example, I run the following from a TTY:

[cprussin@awesomeo3000 ~]$ DISPLAY=:0 setxkbmap -query
rules:      evdev
model:      evdev
layout:     dvorak
options:    caps:escape
[cprussin@awesomeo3000 ~]$ DISPLAY=:0 setxkbmap us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)+capslock(escape)
geometry:   pc(pc104)
[cprussin@awesomeo3000 ~]$ DISPLAY=:0 setxkbmap -query
rules:      evdev
model:      evdev
layout:     us
options:    caps:escape

But it lies!  When I switch back to my X session, it is still in dvorak!  Weirder still, when I run setxkbmap -query in a terminal in the X session, the output still shows "layout:     us"!  So clearly setxkbmap thinks the keymap has been set, when indeed it has not.  I don't really know how I can debug this further, short of looking at setxkbmap's source to see where -query pulls it's information from (which I'm about to start doing).  Does anyone else know the problem or have any tips on debugging?

Thanks in advance!

Offline

Board footer

Powered by FluxBB