Simptoms:
- keyboard layouts missing (in KDE Control Center -> Regional / Accessibility -> Keyboard Layouts -> Layout tab)
- keys not working such as pipe character and Croatian specific characters: šđžčć
- (EE) XKB: Couldn't open rules file /usr/share/X11/xkb/rules/xkb in /var/log/Xorg.0.log
- strace setxkbmap hr would also complain about failing to find the rules file
The strace output was the one that finally solved the problems for me. I was finally able to derive from the output of the 'strace setxkbmap hr' that setxkbmap is looking for a file constructed from option "XkbRules" of the keyboard InputDevice section of xorg.conf. It would take that value and construct a path to the rules file. My current xorg.conf contains the following:
Code:
Section "InputDevice"
Identifier "Trust SlimLine Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "base"
Option "XkbModel" "pc105"
Option "XkbLayout" "hr"
EndSection
Now that it works it constructs the following path: /usr/share/X11/xkb/rules/base.lst which can also be spoted in the strace output:
# strace setxkbmap hr
Code:
open("./rules/base-C.lst", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./rules/base.lst", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/X11/xkb/rules/base-C.lst", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/X11/xkb/rules/base.lst", O_RDONLY) = 4
So if you have trouble getting your keyboard layout rolling this little debugging session might be of hand to you. Feeling great to give something back to the majestic Open Source community. Do good and prosper!