You are not logged in.
Pages: 1
Hello,
I cannot seem to change my keymap. I have tried adding:
setxkbmap -layout dk
to
/etc/skel/.xinitrc , so it looks like this:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
setxkbmap -layout dk,us -option grp:alt_shift_toggle
# exec gnome-session
# exec startkde
exec startxfce4
# ...or the Window Manager of your choice
but it doesn't change anything. Both languages are uncommented in
/etc/locale.gen.
Is there anything that I am missing here? Please help!
Last edited by AlexanderHolmgaard (2014-11-20 17:01:06)
Offline
What happens when you run the setxkbmap command in a terminal?
Also, is there a reason why you don't want to set the keyboard layout via the X config files (and localectl)?
Offline
Tried running the setxkbmap -layout dk,us -option grp:alt_shift_toggle command in a terminal now. It worked, perfect. Thanks a lot!
Offline
So, does this mean that you are going to change the keymap every time you log in?
As for changing the layout on login, which display manager or desktop enviornment do you use?
Last edited by runical (2014-11-20 12:36:39)
Offline
Read the wiki. Don't edit /etc/skel/.xinitrc, copy it to ~/.xinitrc and edit it there.
When posting configs, code or command output, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode
like this
It makes the code more readable and - in case of longer listings - more convenient to scroll through.
Offline
Tried copying the /etc/skel/.xinitrc to the home directory and editing it there, adding the command I mentioned above. Still doesn't work. When I run the command in a terminal it works, but then after reboot its gone.
I use XFCE and LightDM.
And Karol, yes, I shall do that from now on, my apologies
Any thoughts on what I can do from here? Thanks for helping me out, guys!
Offline
LightDM does not source xinitrc if I am not mistaken, so it is not really a surprise. There are 2 things you can do:
1. Change your keymap via X config files (as mentioned in the wiki for keyboard layout in X)
2. Add the setxkbmap command to the startup commands for XFCE
Personally, I'd go for solution 1 as it will give you a consistent keymap across all users and DE/WM. Solution 2 is quick and easy, but it will only work in XFCE and require setting up in every DE/WM you want to use.
P.S. This is all info you can find in the wiki, please do your research.
Last edited by runical (2014-11-20 15:41:27)
Offline
Okay. First I tried changing it via the X config files. That didn't work, I have no idea as to why... So now I added it as one of the startup commands and it is working now. Thanks a lot!
Offline
Strange. Did you try using localectl? The point with localectl is that you need to provide all of the optional arguments, even if you just want to use one (found that out the hard way as well).
Offline
Yes. I ran this command:
localectl set-x11-keymap dk,us pc104 ,qwerty grp:alt_shift_toggle
But still nothing. Checked in the /etc/X11/xorg.conf.d/10-keyboard.conf, and the changes are actually there, but it seemed it still wasn't enabled.. Don't remember if I ran the command as root though, if that makes any difference in this case.
Offline
There's also the Xfce configuration utilities. One of them can manage keyboard layouts.
I haven't used it myself since I'm used to configuring my keyboard layout with X configs.
Offline
Yes. I ran this command:
localectl set-x11-keymap dk,us pc104 ,qwerty grp:alt_shift_toggle
But still nothing. Checked in the /etc/X11/xorg.conf.d/10-keyboard.conf, and the changes are actually there, but it seemed it still wasn't enabled.. Don't remember if I ran the command as root though, if that makes any difference in this case.
Yeah, you should run the command as root. Also, after changing the layout this way, you have to restart your X server (X configs are read on X start).
Offline
Pages: 1