Skip to content

Allow setting locale information from locale1

José Expósito requested to merge jexposit/gnome-kiosk:locale1-option into main

At the moment, the D-Bus interface "org.freedesktop.locale1" sets the keyboard layout for the next session. This is the intended and documented behavior [1]:

Note that SetVConsoleKeyboard() instantly applies the new key mapping to the console, while SetX11Keyboard() simply sets a default that may be used by later sessions.

In the Anaconda installer, we are looking for a way to set the keyboard layout for the current session across desktop environments [2].

At the moment of writing this:

  • KWin allows to use the --locale1 command line option to make the SetX11Keyboard() D-Bus method change the current keyboard layout [3]
  • A script is available in Sway to sync input configuration with org.freedesktop.locale1 [4]

Fallback to system configuration when the session configuration is invalid or is not set:

$ gsettings set org.gnome.desktop.input-sources sources "[]"

[1] https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.locale1.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1955025#c26
[3] https://invent.kde.org/plasma/kwin/-/merge_requests/2921
[4] https://github.com/alebastr/sway-systemd/blob/main/src/locale1-xkb-config
Resolves: #24 (closed)

Edited by José Expósito

Merge request reports