You are not logged in.

#1 2011-09-04 21:17:03

yms
Member
From: Switzerland
Registered: 2009-06-05
Posts: 64

setxkbmap lies about my keyboard layout

Hi,

A script I wrote relies on 'setxkbmap -print' to know what the keyboard layout is (since I sometimes change it).
These days, after a complete reinstall of my system (i.e. all packages up to date) my script sometimes thinks the layout is US:

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+[b]us[/b]+inet(evdev)"	};
	xkb_geometry  { include "pc(pc104)"	};
};

but when I actually use my keyboard, the layout is CH (FR) as it should be (characters like é, à and è work). The output of 'setxkbmap -print' should be:

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+[b]ch(fr)[/b]+inet(evdev)"	};
	xkb_geometry  { include "pc(pc104)"	};
};

Bottomline is: I don't change my layout (so it is CH (FR) as always) but 'setxkbmap -print' tells me it is US, which is wrong.
This seems to happen quite randomly (sometimes at boot) and the "fix" I have found is to explicitely reset the layout to CH (FR).
Is there a better way than 'setxkbmap -print' to know what is the current layout or is there a way to fix this problem ?

Thank you in advance.

Last edited by yms (2011-09-04 21:34:00)


Sorry for any English mistakes, I am not a native speaker.

Offline

#2 2011-09-04 21:26:17

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: setxkbmap lies about my keyboard layout

How do you set your kbd layout?
I have 'setxkbmap pl' in my .xinitrc so maybe the layout is different before it runs i.e. when I boot into console. I can't check it right now, but I will later.

Oh, and please use [ code ] tags, not [ quote ] tags for posting snippets of code.

Last edited by karol (2011-09-04 21:27:12)

Offline

#3 2011-09-04 21:33:26

yms
Member
From: Switzerland
Registered: 2009-06-05
Posts: 64

Re: setxkbmap lies about my keyboard layout

At boot, I have:

KEYMAP="fr_CH-latin1"

in my /etc/rc.conf. But then when I need to switch it while working, I use 'setxkbmap bg phonetic', 'setxkbmap ch fr' and whatever I need, always with setxkbmap.


Sorry for any English mistakes, I am not a native speaker.

Offline

Board footer

Powered by FluxBB