LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to get a US keymap in X? (https://www.linuxquestions.org/questions/slackware-14/how-to-get-a-us-keymap-in-x-864799/)

Josh000 02-24-2011 11:54 AM

How to get a US keymap in X?
 
in 13.0 I remember I had to setup some HAL stuff to get a UK keyboard.

Now I have upgraded to 13.1 and my keyboard has been replaced with a US keyboard, so I would like to change the keymap to match.


From what I have found when reading X no longer uses HAL? In which case, how would I change the keymap?

AFAIK, I am not using an xorg config file.

guanx 02-24-2011 12:00 PM

Code:

setxkbmap gb

Josh000 02-24-2011 12:18 PM

I guess you mean setxkbmap us


There isn't a more permanant solution? I know I could put that in my xinitrc but I thought there would be a more permanant way.

Buumi 02-24-2011 12:41 PM

From ftp://mirrors.kernel.org/slackware/s..._AND_HINTS.TXT

If you need to use a non-US keyboard layout, then copy the file located at
/usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi to /etc/hal/fdi/policy
and edit it to suit your needs. Have a look at the contents of that file
for an example and more information. If you prefer to do this the "old" way
using /etc/X11/xorg.conf, then you can use "X -configure" or "xorgsetup" to
generate an xorg.conf, then add the following lines to the "ServerFlags"
section to disable input device hotplugging via HAL:
Option "AllowEmptyInput" "false"
Option "AutoAddDevices" "false"
Option "AutoEnableDevices" "false"
This is also relevant if you prefer to disable HAL completely for whatever
reason.


I wish I understood your question correctly. I was having the problem with wrong keymap just last week and at least this helped. Someone else correct me if it's completely wrong. The first one seems to be way with HAL though but it worked for me at least and later one shouldn't need HAL.

But for me it was by default US.

H_TeXMeX_H 02-24-2011 12:53 PM

Quote:

Originally Posted by Buumi (Post 4269922)
From ftp://mirrors.kernel.org/slackware/s..._AND_HINTS.TXT

If you need to use a non-US keyboard layout, then copy the file located at
/usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi to /etc/hal/fdi/policy
and edit it to suit your needs.

I agree with this solution, this is probably the way you changed it to the UK keymap, if you copy back the original, or delete '/etc/hal/fdi/policy/10-keymap.fdi', it should work.

Josh000 02-24-2011 01:38 PM

I did indeed setup the UK keymap by copying '/etc/hal/fdi/policy/10-keymap.fdi' originally, however deleting it did not result in a us keymap when restarting X.

H_TeXMeX_H 02-24-2011 02:39 PM

You have to restart hal: '/etc/rc.d/rc.hald restart'

tobyl 02-24-2011 03:09 PM

Josh,

I think this also depends on whether you use evdev. I copied /usr/share/X11/xorg.conf.d/90-keyboard-layout.conf

to /etc/X11/xorg.conf.d/90-keyboard-layout.conf (this overrides upgrades to /user/share/X11/... reverting your settings)

and modified the entries to Option "XkbLayout" "gb"

well it worked for me...

tobyl


All times are GMT -5. The time now is 02:40 PM.