-   Slackware (
-   -   Small problem with xorg.conf and setxkbmap (

NorthBridge 10-20-2012 05:19 PM

Small problem with xorg.conf and setxkbmap
Good evening :)

First, I should say hello to everyone here, since I'm new to Slackware (coming from Arch Linux). It's a sweet distro, and I think it's just what I needed, so I hope I will continue using it for as long as possible.

Anyway, enough bla-bla, here's the problem:

Just after finishing the installation, and setting up X + E17 for a window manager, my next task was to add my second keyboard layout I usually use. Normally E17 (at least in Arch) has a keyboard module, which does the job, but in the version I installed on slack I couldn't find it. Nothing serious, I thought, since I remembered a little trick from the days of Kubuntu 8.04 - directly adding the layouts in xorg.conf. Here's what I currently have in the keyboard section in xorg.conf:

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbRules" "xorg"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us,bg"
        Option      "XkbVariant" ",phonetic"
        Option      "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"

The problem is, even after restarting X, when I press alt+shift, the layout doesn't change at all - but if I write manually in a terminal

setxkbmap -model pc105 -layout us,bg -variant ,phonetic -option grp:alt_shift_toggle,grp_led:scroll
,everything works like a charm.

What am I missing, something really stupid, or some weird conflict between the WM and X?

bathory 10-21-2012 02:17 AM


These options go into a .conf file under /etc/X11/xorg.conf.d
You can copy /usr/share/X11/xorg.conf.d/90-keyboard-layout.conf there and edit it to your likings.


lopid 10-21-2012 07:23 AM

I found the same problem a year ago when I tried out Dvorak, and I ended up doing just as you did. I actually bound some keyboard shortcuts to switch to and from layouts dynamically, using similar setxkbmap commands, and had a little applet in the systray that showed the current language flag.

NorthBridge 10-21-2012 08:20 AM

Worked like a charm! Thanks a lot :)

Just a quick question. What is the keyboard section in xorg.conf's purpose, since it doesn't control the actual keyboard - kind of fallback in case of failure, or something else?

lopid 10-21-2012 08:32 AM

You'd probably be best off copying /usr/share/X11/xorg.conf.d/90-keyboard-layout.conf to /etc/X11/xorg.conf.d/90-keyboard-layout.conf, and editing the latter, because I see your code snippet is using 'InputDevice' instead of 'InputClass', and your Identifier and Driver are different to how they are in the former, which is probably why it's not controlling the keyboard for you.

All times are GMT -5. The time now is 10:00 PM.