XFCE keyboard layout

Soldato
Joined
8 Nov 2003
Posts
7,409
Location
UK
Hi there,

Am using Archlinux and have a niggly little program with regards to the keyboard layout.

Everytime I reboot I am defaulted back to the US keyboard and so I have to login as root in the terminal and type 'setxkbmap gb'.

Here is my xorg config:

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb"
Option "XkbVariant" "nodeadkeys"


Any thoughts?
 
hmm just a thought although it may very well not be related to your problem, is the keyboard map correctly configured to GB in /etc/rc.conf?
 
It's set to 'UK' because 'GB' isn't recognized.

LOCALE="en_GB.utf8"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/London"
KEYMAP="uk"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
 
Is there a way of executing a startup script to automatically set the keyboard map to gb rather than me having to manually type it each time I log in?
 
GNU nano 2.0.7 File: /etc/rc.local

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
for i in $(seq 6); do /usr/bin/setleds -D +num < /dev/vc/${i} >/dev/null; done

{ echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register; } 2$

setxkbmap gb

Didn't work. How do I make it work?
 
You need to put the full path to setxkbmap as it isn't run in a user shell, and hence doesn't have the PATH variable. Hopefully that will fix it :s

EDIT: if that doesn't work, redirect its output to a file so you can see whats happening eg: /usr/bin/setxkbmap > /home/enfiled/log.txt
 
Last edited:
Sorry, ok you need to find the full path to the setxkbmap program, so in a shell type: whereis setxkbmap it will probably say: setxkbmap: /usr/bin/setxkbmap

So open up /etc/rc.local, and make sure the last line looks like:

/usr/bin/setxkbmap gb (as long as that path matches yours)

That should do the trick.
 
It didn't work mate. Here is what i've got:

GNU nano 2.0.7 File: /etc/rc.local

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
for i in $(seq 6); do /usr/bin/setleds -D +num < /dev/vc/${i} >/dev/null; done

{ echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register; } 2$

/usr/bin/setxkbmap gb
 
hmm ok, my guess would be that it wont work because your loading it before XFCE starts, and when that starts it overwrites your selected keymap. Just had a look and XFCE has its own startup script.

Scroll down to Xfce here: http://gentoo-wiki.com/HOWTO_Autostart_Programs

Programs that you wish to autostart on Xfce4 startup can be selected by using the xfce4-autostart-editor tool available in Xfce4 menu > Settings > Xfce 4 Autostarted Applications.

See if you can add a command using that GUI, or failing that follow the instructions to put a script in the autostart folder.

your script will be:
Code:
#!/bin/bash
/usr/bin/setxkbmap gb

Then make it executable: chmod +x myscript and copy it to the autostart folder.

Hope thats some help, will get there eventually :p
 
Back
Top Bottom