# Keyboard layout in X.org 1.14 problems



## mrstolpe (Jan 17, 2015)

I really tried reading other threads before posting this.

Here goes:

I just upgraded X to 1.14 and after some tweaking most things seem to work, however the configuration does not seem to make any difference.

/var/log/Xorg.0.log says:


```
[  38.803] (II) config/devd: probing input devices...
[  38.803] (II) config/devd: adding input device (null) (/dev/kbdmux)
[  38.803] (**) kbdmux: Applying InputClass "Keyboard Defaults"
[  38.803] (II) LoadModule: "kbd"
[  38.804] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[  38.804] (II) Module kbd: vendor="X.Org Foundation"
[  38.804]  compiled for 1.14.7, module version = 1.8.0
[  38.804]  Module class: X.Org XInput Driver
[  38.804]  ABI class: X.Org XInput driver, version 19.1
[  38.804] (II) Using input driver 'kbd' for 'kbdmux'
[  38.804] (**) kbdmux: always reports core events
[  38.804] (**) kbdmux: always reports core events
[  38.805] (**) Option "Protocol" "standard"
[  38.805] (**) Option "XkbRules" "base"
[  38.805] (**) Option "XkbModel" "pc105"
[  38.805] (**) Option "XkbLayout" "us"
[  38.805] (**) Option "config_info" "devd:kbdmux"
```

And my problem is I want Swedish keyboard layout. Which works before I start X...

I tried putting things in /usr/local/etc/X11/xorg.conf.d/input.conf like


```
Section "InputDevice"
  Identifier  "Keyboard0"
  Driver  "kbd"
  Option "Protocol" "standard"
  Option "XkbRules" "base"
  Option "XkbModel" "pc105"
  Option "XkbLayout" "se"
EndSection
```

But it does not seem to have any effect whatsoever.

What am I missing?


----------



## mrstolpe (Jan 17, 2015)

Well now,

I tried one more thing after posting this, and it seems there is a new syntax:

/usr/local/etc/X11/xorg.conf.d/input.conf


```
Section "InputClass"
  Identifier "Keyboard Defaults"
  Driver "keyboard"
  MatchIsKeyboard  "on"
  Option "Protocol" "standard"
  Option "XkbRules" "base"
  Option "XkbModel" "pc105"
  Option "XkbLayout" "se"
EndSection

Section "InputClass"
  Identifier "Mouse Defaults"
  Driver "mouse"
  MatchIsPointer "on"
EndSection
```

Made the deal.

Well, maybe it helps someone.


----------



## free-and-bsd (Jan 17, 2015)

How do you start X? What DE are you running under X?
I have solved this problem by creating ~/.xinitrc, where among other things I've put this:

```
.....
setxkbmap -layout "us,fr(oss),ru" -variant -option grp:alt_shift_toggle,terminate:ctrl_alt_bksp,compose:rctrl &
.....
exec $WM
```
As you can see in the `-layout "us,fr(oss),ru"` part of it, I define three layouts I need, then set the switching option to Alt+Shift, and X termination to Ctrl+Alt+Backspace.
To launch my desktop I type this command:

```
WM=fvwm2 xinit
```
This works faster than startx. Replace "fvwm2" with your desktop and it'll work the same for you, I hope.


----------



## mrstolpe (Jan 17, 2015)

free-and-bsd said:


> How do you start X? What DE are you running under X?



I usually start X via kdm. (`/usr/local/etc/rc.d/kdm4 forcestart`) to run KDE. It was the same thing with any X though.



free-and-bsd said:


> I have solved this problem by creating ~/.xinitrc, where among other things I've put this:
> 
> ```
> .....
> ...



I see it becomes a bit more complicated when you need more than one option.


----------



## free-and-bsd (Jan 18, 2015)

mrstolpe said:


> I usually start X via kdm. (`/usr/local/etc/rc.d/kdm4 forcestart`) to run KDE.


 Ah, you're using KDE then. How about this page? xorg.conf never had its effect in KDE regarding keyboard settings. Well, maybe it did some long time ago , I started using it from version 3 and even there it was configured via KDE control-center.

As for me, I do it via .xinitrc because I'm using TWM and FVWM WMs, which don't have these control centers and menus, except the ones you create yourself.
KDE and GNOME interfere with such settings set in xorg.conf, and generally xorg.conf is not even needed these days in most cases -- so it evidently doesn't play anymore the role it used to play. But thankfully, good old .xinitrc still can be used. In fact, I came to this after getting disappointed with those big gimmicky DEs like GNOME and KDE, which consume your attention (let alone system resources) and need your care rather than be really helpful.


----------



## wblock@ (Jan 18, 2015)

mrstolpe said:


> /usr/local/etc/rc.d/kdm4 forcestart



This can be done more easily with `service kdm4 forcestart`.


----------

