Xorg and console keyboad layouts

I fixed a bug that has been in Puppy for a very long time, maybe always.

When the Xorg Wizard is run, it looks at the console keyboard layout as specified in /etc/keymap and puts an appropriate value into this line in /etc/X11/xorg.conf:

Option "XkbLayout" "us" #xkeymap0

That's fine, however if the Keyboard Wizard is used to change to a different layout, /etc/keymap gets changed and the console layout is updated, however the layout in xorg.conf is not changed.

I have modified /usr/bin/xwin, which is the script that is used to start X, to check for a mismatch between console and Xorg keyboard layout and if found then fix it.

Note, the same situation can occur if the "pkeys" kernel boot parameter is used to change the current setting in /etc/keymap. That is fixed also.

This fix is in Woof, that I will upload soon.


Posted on 27 Jan 2010, 17:58


Comments:

Posted on 27 Jan 2010, 18:04 by pakt
NLS problem
Barry, I may have found the cause of dead keys when keyboard is set to Swedish. Details here:
http://www.murga-linux.com/puppy/viewtopic.php?p=386567#386567


Posted on 29 Jan 2010, 19:23 by mories
Typo error in xwin
There is a typo error in xwin at the line that change
Option "XkbLayout" "us" #xkeymap0

In sed -i -e "${xkPATTERN}" .....
must be sed -i -e "${skPATTERN}" ...

The error cause no change keyb layout in X.


Posted on 30 Jan 2010, 8:22 by BarryK
Re xwin typo
mories,
Thanks for finding that, I've fixed it.



Posted on 3 Feb 2010, 10:56 by shinobar
modifying xorg.conf
Hi Barry,
I think the code modifying xorg.conf should be performed in input-wizard and not in xwin.

Because the user may like to edit xorg.conf by hand and not modified at starting X.


Posted on 3 Feb 2010, 14:59 by BarryK
xwin to input-wizard
shinobar,
yes, I think that I will have to move it.

I put it in xwin because I was thinking what if someone edited /etc/keymap file, or booted with a different pkeys value. Then xwin would catch those changes and make sure the that xorg is also set correctly.

But then there is the problem, if leave it in xwin, and user edits xorg.conf, restarts X, then xwin will change it back.