From 8fa5d1e053259dec3671c02ea9bc40d6e2aa8d8b Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Wed, 2 Jul 2025 00:45:02 -0400 Subject: [PATCH] envmanager: Allow user to change the vkbd Currently the vkbd setting (to maliit) is immutable, preventing users from selecting different input methods. Loosen the envmanager setting so that it's just a default value, which can be overriden by users. --- envmanager/config.h | 18 ++++++++++++------ envmanager/settings.cpp | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/envmanager/config.h b/envmanager/config.h index 9d794115..196aa4e5 100644 --- a/envmanager/config.h +++ b/envmanager/config.h @@ -13,7 +13,7 @@ #include #include -// applications-blacklistrc +// .config/applications-blacklistrc // NOTE: we only write these entries if they are not already defined in the config const QMap> APPLICATIONS_BLACKLIST_DEFAULT_SETTINGS = { {"Applications", @@ -26,13 +26,20 @@ const QMap> APPLICATIONS_BLACKLIST_DEFAULT_SETT "waydroid.com.android.inputmethod.latin,waydroid.com.android.settings,waydroid.org.lineageos.eleven,waydroid.org.lineageos.etar," "waydroid.org.lineageos.jelly,waydroid.org.lineageos.recorder,wordview"}}}}; -// kdeglobals -// NOTE: we only write these entries if they are not already defined in the config +// .config/plasma-mobile/kdeglobals - non-immutable settings: const QMap> KDEGLOBALS_DEFAULT_SETTINGS = {{"General", {{"BrowserApplication", "angelfish"}}}}; +// .config/plasma-mobile/kdeglobals - immutable settings: const QMap> KDEGLOBALS_SETTINGS = {{"KDE", {{"LookAndFeelPackage", "org.kde.breeze.mobile"}}}}; -// plasma-mobile/kwinrc +// .config/plasma-mobile/kwinrc - non-immutable settings: +const QMap> KWINRC_DEFAULT_SETTINGS = { + {"Wayland", + { + {"InputMethod", "/usr/share/applications/com.github.maliit.keyboard.desktop"} // ensure maliit is our default vkbd + }}}; + +// .config/plasma-mobile/kwinrc - immutable settings: QMap> getKwinrcSettings(KSharedConfig::Ptr m_mobileConfig) { auto group = KConfigGroup{m_mobileConfig, QStringLiteral("General")}; @@ -54,7 +61,6 @@ QMap> getKwinrcSettings(KSharedConfig::Ptr m_mo }}, {"Wayland", { - {"InputMethod", "/usr/share/applications/com.github.maliit.keyboard.desktop"}, // ensure maliit is our vkbd {"VirtualKeyboardEnabled", true} // enable vkbd }}, {"org.kde.kdecoration2", @@ -73,5 +79,5 @@ QMap> getKwinrcSettings(KSharedConfig::Ptr m_mo const QList KWIN_EFFECTS = {"blur", "mobiletaskswitcher", "screenedge"}; const QList KWIN_SCRIPTS = {"convergentwindows"}; -// plasma-mobile/ksmserver +// .config/plasma-mobile/ksmserver - immutable settings: const QMap> KSMSERVER_SETTINGS = {{"General", {{"loginMode", "emptySession"}}}}; diff --git a/envmanager/settings.cpp b/envmanager/settings.cpp index c467d16d..1d98d614 100644 --- a/envmanager/settings.cpp +++ b/envmanager/settings.cpp @@ -80,6 +80,7 @@ void Settings::applyMobileConfiguration() auto kwinrc = kwinrcConfig(); writeKeys(MOBILE_KWINRC_FILE, kwinrc, kwinSettings); + writeKeys(MOBILE_KWINRC_FILE, kwinrc, KWINRC_DEFAULT_SETTINGS); // only write, don't make immutable kwinrc->sync(); reloadKWinConfig();