LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Keyboard layouts missing = 5 hours martirdom + debug session with good learning value (https://www.linuxquestions.org/questions/linux-software-2/keyboard-layouts-missing-%3D-5-hours-martirdom-debug-session-with-good-learning-value-789407/)

vsurlan 02-16-2010 02:07 AM

Keyboard layouts missing = 5 hours martirdom + debug session with good learning value
 
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!


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