--- Begin Message ---
Subject: |
[PATCH 0/4] Add localed, fixing keyboard layout in GDM |
Date: |
Wed, 3 Apr 2019 11:41:54 +0200 |
Hello Guix!
This patch adds localed, a D-Bus service for keyboard layout
and “locales” (not quite actually):
https://www.freedesktop.org/wiki/Software/systemd/localed/
The only motivation was to fix keyboard layout in GDM: until
now, GDM would always install a US English layout, regardless
of how we configured Xorg. It did that because it tried to
ask localed about the current keyboard layout, but since that
daemon was unavailable, it would assume that the current layout
is US English and tell XKB to install it.
You would think that it would simply ask X to know what the
current layout is—after all, X knows that first-hand. But no!
Instead, there’s this localed daemon that normally goes ahead
and greps /etc/X11/xorg.d/00-keyboard.conf in search of
“XkbLayout” and similar options.
This patch modifies localed so that it gets this information
directly from environment variables set by our ‘localed’ service;
their values is inherited from the ‘xorg-configuration’ field of
<gdm-configuration>.
This is all pretty ugly. Regarding localed itself, I think we
should maintain our own fork since we really just need a couple
of files from systemd. That would require disentangling the code
from systemd’s own support functions (like its D-Bus API wrapper).
That should be easy for someone who’s ever played with D-Bus in
C, but that’s not me. :-)
Another option, of course, is to write a D-Bus implementation in
Guile and do the whole thing in Guile. Shave a yak!
Anyway, in the meantime, this thing does the job.
Thoughts?
Ludo’.
Ludovic Courtès (4):
services: dbus: Add 'wrapped-dbus-service'.
gnu: Add localed, extracted from systemd.
services: dbus: 'wrapped-dbus-service' accepts a list of variables.
services: Add 'localed' service type and have GDM extend it.
gnu/local.mk | 1 +
gnu/packages/freedesktop.scm | 148 +++++++-
.../patches/localed-xorg-keyboard.patch | 322 ++++++++++++++++++
gnu/services/dbus.scm | 48 +++
gnu/services/desktop.scm | 52 +--
gnu/services/xorg.scm | 89 ++++-
6 files changed, 612 insertions(+), 48 deletions(-)
create mode 100644 gnu/packages/patches/localed-xorg-keyboard.patch
--
2.21.0
--- End Message ---
--- Begin Message ---
Subject: |
Re: [bug#35118] [PATCH 0/4] Add localed, fixing keyboard layout in GDM |
Date: |
Fri, 05 Apr 2019 15:47:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,
Pushed!
Ludovic Courtès <address@hidden> skribis:
> This is all pretty ugly. Regarding localed itself, I think we
> should maintain our own fork since we really just need a couple
> of files from systemd. That would require disentangling the code
> from systemd’s own support functions (like its D-Bus API wrapper).
> That should be easy for someone who’s ever played with D-Bus in
> C, but that’s not me. :-)
As discussed on IRC with Julien and others, I tried to actually fork
systemd and strip everything but src/locale. Unfortunately that turned
out to be pretty tricky because of all the systemd-internal utilities
being used (allocation, string manipulation, etc.)
If someone is willing to give it a try, I can share what I have so far!
Ludo’.
--- End Message ---