spiegel-keyman/linux/keyman-config/keyman_config
Eberhard Beilharz 7574d2eb68
Merge pull request #14953 from keymanapp/fix/linux/14911_instshared
fix(linux): fix installing keyboard in shared area 🍲

Installing into the shared area (`/usr/local/share`) requires `root` permissions, so in order to install into the shared area the user has to call `km-package-install` with `sudo`. But we also want to add the keyboard to the user's list of available keyboards so that he can switch to it. That needs to be done in the user context. However, when `sudo` ran the command in the user context, the environment variables to connect to the user's session dbus were not set.

This change fixes this by passing `DBUS_SESSION_BUS_ADDRESS` along with the `sudo -u <user>` call. Since `root` doesn't have this variable set (or at least not pointing to the user's dbus), we construct the dbus address based on the user's uid.

On newer Ubuntu versions (>=25.04) we also have to set `XDG_RUNTIME_DIR`, at least when running the autopkgtests.

Fixes: #14911
2025-10-16 15:33:34 +02:00
..
icons rename keymanconfig to keyman_config 2018-09-01 12:28:16 +07:00
standards fix(linux): Improve error handling if lang_tags_map.py is missing 2021-06-23 17:09:59 +02:00
__init__.py fix(linux): fix installing keyboard in shared area 2025-10-14 17:54:36 +02:00
accelerators.py chore(linux): Sorting of imports 2022-07-18 15:19:50 +02:00
bcp47tag.py fix(linux): Use raw string for regex 2024-02-06 17:01:59 +01:00
canonical_language_code_utils.py fix(linux): normalize language tags from keyboard 2025-08-18 19:49:38 +02:00
check_mime_type.py chore(linux): Sorting of imports 2022-07-18 15:19:50 +02:00
convertico.py refactor(linux): make method private and change variable names 2024-06-14 15:58:21 +02:00
custom_keyboards.py feat(linux): Deal with temporary dbus session 2024-03-22 12:54:50 +01:00
dbus_util.py Apply suggestions from code review 2025-10-16 15:17:35 +02:00
dconf_util.py refactor(linux): Fix warning 2023-08-28 20:11:41 +02:00
deprecated_decorator.py chore(linux): Add deprecated decorator 2021-06-25 18:52:10 +02:00
downloadkeyboard.py feat(linux): improve Sentry error reports 2025-09-16 18:23:47 +02:00
fcitx_util.py Do not restart Fcitx 2023-12-07 13:41:21 -08:00
get_info.py chore(linux): More import sorting 2022-07-18 17:10:01 +02:00
get_kmp.py fix(linux): refactor common strings 2025-10-16 12:33:56 +02:00
gnome_keyboards_util.py feat(linux): improve Sentry error reports 2025-09-16 18:23:47 +02:00
gsettings.py Merge pull request #14953 from keymanapp/fix/linux/14911_instshared 2025-10-16 15:33:34 +02:00
handle_install.py feat(linux): improve Sentry error reports 2025-09-16 18:23:47 +02:00
ibus_util.py fix(linux): refactor common strings 2025-10-16 12:33:56 +02:00
install_kmp.py fix(linux): fix installing keyboard in shared area 2025-10-14 17:54:36 +02:00
install_window.py Merge branch 'master' into chore/merge-beta-into-master-B18S2 2025-03-01 15:45:19 +07:00
keyboard_details.py chore(linux): fall back to package id 2025-04-03 15:56:07 +02:00
keyboard_layouts_model.py refactor(linux): Extract widgets to separate classes and files 2023-06-13 20:05:48 +02:00
keyboard_layouts_widget.py refactor(linux): Rename OptionsView to KeyboardOptionsView 2023-06-13 20:05:49 +02:00
keyboard_options_view.py chore: Revert "Merge branch 'master' into beta" 2025-02-14 07:45:28 +07:00
keyman_option.py chore(linux): change SIL International to SIL Global 2024-12-10 10:26:44 +01:00
kmpmetadata.py feat(linux): improve Sentry error reports 2025-09-16 18:23:47 +02:00
kvk2ldml.py refactor(linux): remove warning 2025-09-15 16:52:07 +02:00
list_installed_kmp.py fix(linux): Replace deprecated pkg_resources module in remaining places 2024-03-20 11:44:00 +01:00
options_widget.py feat(linux): implement UI part of SimulateAltGr option 2024-06-21 18:24:02 +02:00
sentry_handling.py chore(linux): don't report errors to Sentry when running autopkgtests 2025-10-13 18:29:24 +02:00
uninstall_kmp.py fix(linux): fix installing keyboard in shared area 2025-10-14 17:54:36 +02:00
version.py.in fix(linux): fix variable replacements 2025-05-22 16:20:18 +02:00
view_installed.py feat(linux): re-create missing files at run-time 2024-06-14 18:11:11 +02:00
welcome.py chore: Revert "Merge branch 'master' into beta" 2025-02-14 07:45:28 +07:00