[systemd-devel] Changing how localed writes keymap for xorg

Colin Guthrie gmane at colin.guthr.ie
Wed Feb 11 02:43:54 PST 2015


Hi,

I've recently run into an annoying problem with the localed xorg.conf
snippet.

As it writes an xorg.conf.d snippet, this seems ot take priority over
udev properties (xkblayout) etc. which Xorg has supported for some time.

If x starts with this snippet in place and it has a layout of e.g "us",
but then, later a keyboard with a udev property of xkblayout fr is
plugged in (don't worry about where that property comes from, this is a
supported feature of the config/udev.c in xserver), it will still get
the us keymap. This sucks!


Also, anything plugged in to Xorg after running localectl (thus updating
00-keyboard.conf) will also get the "us" keymap (as that was what was in
place at Xorg init time).

Wouldn't it be better to do the following:

1. deprecate the 00-keyboard.conf xorg.conf.d file
2. Instead apply the locale settings in udev via "xkb*" properties

This then allows the properties to change during runtime and the keymaps
will be much more hotplug friendly and reactive to dynamic changes.

GNOME seems to work around this by supporting per-user preferences for
keymaps and thus (I presume) watches for new keyboards in g-s-d and
applies the correct keymap accordingly (as it can override the global
preference). However in "simpler" environments without such a settings
daemon, the above approach should allow for the dynamic stuff OOTB after
localed writes it's updated config.


If this isn't something that's desirable, then a half way house would be
to not write XkbLayout and XkbModel to the xorg.conf snippet when the
values are "us" and "pc104" respectively, as these are the evdev
defaults and thus it would play nicer with udev properties override
xkblayout and xkbmodel accordingly. It's certainly not as dynamic, but
it at least helps.


WDYT?


Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list