From 58e43d4c4ab4fc1b2ded4c687b56e4e7d9a6dd5b Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Mon, 28 Sep 2026 10:52:28 +0200 Subject: [PATCH] fix: turning the theme off no longer brings back single user's launcher restriction when single user was turned off in between --- CHANGELOG.md | 3 ++- lib/single-user.sh | 18 ++++++++++++++++++ lib/vapor-theme.sh | 6 +++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 388b47e..79ee9b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ one per merged pull request. - `bee18b7` **docs: the agent merges feature/bugfix branches into the release branch; the release into main stays the user's** - `501c0ba` **docs: gh or git for merging into the release branch** - `b1adacb` **docs: gh is required for the release-branch pull requests; ask the user to install it** -- **chore: the v2 app preview is gone (it is the released app): no preview pre-release step in CI, no mention in steamify-app.sh** +- `ced4a45` **chore: the v2 app preview is gone (it is the released app): no preview pre-release step in CI, no mention in steamify-app.sh** +- **fix: turning the theme off no longer brings back single user's launcher restriction when single user was turned off in between** ## 2.6.0 - 2026-09-27 diff --git a/lib/single-user.sh b/lib/single-user.sh index 8387c22..dfa6423 100644 --- a/lib/single-user.sh +++ b/lib/single-user.sh @@ -101,6 +101,24 @@ single_launcher() { done } +single_launcher_drop() { + # The theme's layout backup is taken when it's turned on: with single + # user on then, it holds single's launcher keys, and restoring it after + # single was turned off brings them back. Drop exactly single's values + # (a launcher set up differently by the user is left alone). + local applet + local -a kick_args + for applet in $(plasma_applets org.kde.plasma.kickoff); do + kick_args=(--file plasma-org.kde.plasma.desktop-appletsrc --group Containments --group "${applet%%:*}" + --group Applets --group "${applet#*:}" --group Configuration --group General) + [[ "$(kreadconfig6 "${kick_args[@]}" --key primaryActions)" == 3 ]] && + kwriteconfig6 "${kick_args[@]}" --key primaryActions --delete + [[ "$(kreadconfig6 "${kick_args[@]}" --key systemFavorites)" == 'suspend,reboot,shutdown' ]] && + kwriteconfig6 "${kick_args[@]}" --key systemFavorites --delete + done + return 0 +} + single_enable() { info "Turning off the lock screen, user switching and logging out..." stop_plasmashell_for_edit diff --git a/lib/vapor-theme.sh b/lib/vapor-theme.sh index ba0be9d..1974c4b 100644 --- a/lib/vapor-theme.sh +++ b/lib/vapor-theme.sh @@ -134,7 +134,11 @@ theme_disable() { fi # After the tools above, so keys that weren't set before are removed again. krevert theme - single_status && single_launcher + if single_status; then + single_launcher + else + single_launcher_drop + fi restart_plasmashell_if_stopped qdbus6 org.kde.KWin /KWin org.kde.KWin.reconfigure >/dev/null 2>&1 || true