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

David Herrmann dh.herrmann at gmail.com
Thu Feb 12 10:07:45 PST 2015


Hi Colin

On Thu, Feb 12, 2015 at 1:27 AM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>> at which point we need to ask the question: what makes keyboards so special?
>> and the answer seems to be that your DE doesn't support hotplugged
>> keyboards, per-user keyboard settings, etc. So it feels to me, and correct
>> me if I'm wrong here, that you want to reshape the default handling so you
>> don't have to fix it in your DE (I don't actually know which one you're
>> using, sorry).
>
> Yeah, I kinda left that out deliberately as the use case is "a bit
> special". This is basically a pre-DE mini-wizard that kicks in in live
> mode to ask the user what their locale is, setup the language, timezone
> and keyboard and then boots into the DE of choice, whether it be GNOME,
> or KDE or something else (those two being the main ones).
>
> In the case of GNOME, setting the keymap and such is respected (assuming
> there was no 00-keyboard.conf present when X was initialised), but
> language settings (LANG, LC_* etc.) are not, and thus we are forced to
> do a X restart there. For KDE, everything works fine, LANG, keymap etc
> is all fine, and we don't need to restart X for everything to kick in
> correctly which makes for a slightly nicer user experience.
>
> In our case we can simply arrange for there to be no 00-keyboard.conf
> present at init, so it's not the biggest deal in the world. The keymaps
> are set manually *and* any new keyboards that happen to be plugged in
> will be fine too (settings ultimately coming via udev properties in this
> case, but quite possibly appropriate daemons in the DEs will get
> involved at this stage now anyway).
>
> Essentially I was wanting the DE config stuff to be in addition to the
> keyboard being correct in the first place as I don't want to have to go
> around and deal with the same problem on several of the lighter-weight
> DEs which, frankly, are rubbish!
>
> Anyway, that's the background.
>
> Longer term, this scheme is pretty nasty anyway. When we move things
> over to the systemd user session it'll be harder to "pause" the X
> session init and we will probably (have to) totally reassess all this.
> It's pretty nasty to work with as it is, so I personally won't be sorry
> to rip it all out and just do something a lot nicer.
>
> It would also be good to allow for DE-provided first boot type wizards
> to run should they provide their own, and only use the generic one when
> the DE is too rubbish to do this :)

To summarize: Your wizard uses udev-properties to set keymap-settings,
because otherwise you'd have to restart X11 to reload its
configuration, right?

I agree with Peter here: The udev-feature shouldn't really be used.
Xorg only supports static configuration, if you want dynamic
configuration, use the Xinput/Xrandr properties provided by the
drivers. This is how dynamic configurations are done.

Regarding input configuration for non-X11: In systemd-console I use
the localed-API for locale configuration. I think we want something
similar for input-devices and monitor-configuration. Those daemons
could be easily run on the system bus *AND* on the user-bus, to get
system-defaults and user-overrides. But I haven't really thought it
through, it's just an idea.

Thanks
David


More information about the systemd-devel mailing list