This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Why aren't my modifications to xkb working?

Tags: None
(comma "," separated)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
These could quite possibly be distribution defaults, or Xorg automatic handling determining which keyboard layout to use for your keyboard. Your manually written xorg.conf statements should always override this automatic detection though.

Only other thing I could think of are the "xdm" scripts, which are located at /etc/X11/xdm on my system, which could be changing the keyboard layout for you.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Okay. Thanks again. I don't seem to have anything called xdm on my system.

Code: Select all
$ locate -r 'xdm$'
$


It looks like it might be worth me filing an Ubuntu bug too, then.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Interesting. Any scripts named "Xstartup" or similar anywhere?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
No, neither.

Code: Select all
$ locate Xstartup
$
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Okay. I guess LightDM uses another mechanism then. Might be worth checking it's configuration and associated scripts.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Sooooo… I thought I'd see if some autostart file was modifying my settings, so I grepped through the hidden files in my home directory.
Code: Select all
$ GLOBIGNORE=". .."
$ grep -r 'altgr-intl' ~/.*

The output included ~/.kde/share/apps/kded/session/keyboard/layout_memory.xml and ~/.kde/share/config/kxkbrc . I tried changing the references in these files from 'altgr-intl' to 'dvorak', manually setting the keyboard to dvorak with setxkbmap, and restarting. The keyboard was reset to altgr-intl again. :(

I then tried grepping in a few root directories. I saw 'altgr-intl' in /etc/default/keyboard, which contained the following.
Code: Select all
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="altgr-intl"
XKBOPTIONS=""

I repeated as above, and now after restart I was still in dvorak! :) Oddly enough the model is inconsistent, so I'm not sure exactly what is being read from this file.
Code: Select all
$ setxkbmap -query
rules:      evdev
model:      pc104
layout:     us
variant:    dvorak

Now, to try and fix my original problem of xorg xkb configurations not working, I tried to delete /etc/default/keyboard, and also to comment the lines out. In both cases, my xorg xkb configurations still did not work. >:( At least we seem to have narrowed it down though.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Interesting. The /etc/default/keyboard file is likely a Debian specific change (which the Ubuntu family inherits), which is why I haven't seen it before. If you grep around in /etc you will likely find that it is sourced by the X server setup somewhere - where it overrides your xorg.conf configuration.

If you can find where this is sourced from, then you can disable it. I suspect it calls setxkbmap using parameters from that file - and if it provides nothing then it uses a set of defaults hardcoded into it.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
I couldn't really find anything, I'm afraid.

Code: Select all
$ sudo grep -lr '/etc/default/keyboard' /etc
/etc/default/console-setup


That file contains the following:
Code: Select all
if [ -f /etc/default/keyboard ]; then
    . /etc/default/keyboard
fi


I suspect this is not relevant, since I tried removing the file, which should prevent the conditional statement from being executed. Also, from the name of the file, I guess this is just for tty consoles?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Hmm - I suspect it could very well be used by X as well. You might want to try checking to see if "XKBVARIANT" is set in your normal desktop environment - and if it is, then it may be worth looking to see if any scripts reference this variable.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
I'm not sure I understand 100% what you mean. Are you talking about an environment variable? If so, do you mean to see if `$ echo $XKBVARIANT` does anything? There is no output from that command.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Okay, that means it is no longer being set - which means either the variables are only sourced locally by the script in question which changes your keyboard layout, or they variables are not being set at all anymore.

To cover the first scenario, i'd suggest checking under /usr and /etc for the presence of the environment variable in scripts.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
I'm only really getting files with "console" in their name. Am I correct that these are not relevant for KDE/X?

Code: Select all
$ sudo grep -rl XKBVARIANT /etc
/etc/default/keyboard
$ sudo grep -rl XKBVARIANT /usr
/usr/share/doc/xorg/howto/configure-input.html
/usr/share/console-setup/keyboard
$ sudo grep -lr '/etc/default/keyboard' /usr
/usr/share/doc/keyboard-configuration/README.Debian
/usr/share/doc/xorg/howto/configure-input.html
/usr/share/initramfs-tools/hooks/console_setup
/usr/share/apport/package-hooks/source_console-setup.py


I had a look at /usr/share/doc/xorg/howto/configure-input.html , which is essentially identical to this. It mentions both /etc/X11/xorg.conf.d and /etc/default/keyboard , but not comparatively.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Okay, you might want to check /usr/share/console-setup/keyboard for any presence of "setxkbmap" although I doubt it will be present. In this instance, you should probably report an issue to Ubuntu, requesting clarification of why setting the layout via X does not always work - and how this override mechanism in /etc/default/keyboard ties in.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
The only non-commented lines in this file are
Code: Select all
XKBMODEL=pc105      # the model of the keyboard
XKBLAYOUT=us,dvorak # US QWERTY and Dvorak keyboards
XKBVARIANT=intl,    # the US keyboard can generate international symbols
XKBOPTIONS=lv3:ralt_switch,grp:ctrl_shift_toggle # the right Alt selects international symbols, Control+Shift toggles between QWERTY and Dvorak


I've never been assigned these layouts together, nor the variant and options, so I assume that this file is not being sourced.

I've filed another bug to Ubuntu although I find that they are often extremely slow responding.

Thanks for all your help again.
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Just for some closure, I've since moved to Arch, and this works fine, so it does indeed seem like an Ubuntu or Debian bug.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell