Use LogoutPrompt for Restart/Shut Down/Log Out (no root, adds confirmation)#9
Open
LemonAniLabs wants to merge 1 commit into
Open
Conversation
…nding Restart and Shut Down ran `/sbin/reboot` and `/sbin/shutdown now` directly. On systemd setups these need elevated privileges, so for an unprivileged user they silently do nothing; where they do run they act immediately with no confirmation, even though the entries are labelled "Restart..."/"Shut Down..." and emulate the macOS Apple menu, which always confirms. Route Restart, Shut Down and (for consistency) Log Out through the org.kde.LogoutPrompt D-Bus interface, which shows Plasma's standard confirmation dialog and needs no elevated privileges. Also remove an invalid `width: parent` binding on the System Preferences delegate (an Item was assigned to the real-typed `width`); width is already handled by Layout.fillWidth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8.
What
Restart…default:/sbin/reboot→qdbus6 org.kde.LogoutPrompt /LogoutPrompt promptRebootShut Down…default:/sbin/shutdown now→qdbus6 org.kde.LogoutPrompt /LogoutPrompt promptShutDownLog Outdefault:org.kde.Shutdown /Shutdown logout→qdbus6 org.kde.LogoutPrompt /LogoutPrompt promptLogout(consistency)width: parentbinding on the System Preferences delegate (anItemwas assigned to the real-typedwidth; width is already handled byLayout.fillWidth).Why
/sbin/rebootand/sbin/shutdown nowrequire elevated privileges on systemd systems (so they silently do nothing for an unprivileged user) and, where they do run, act immediately with no confirmation — even though the entries are labelled "Restart…/Shut Down…" and emulate the macOS Apple menu, which always confirms.org.kde.LogoutPromptshows Plasma's standard confirmation dialog and works without privileges.Testing
Plasma 6.6.4, Wayland, Ubuntu 26.04. Each entry now opens the expected Plasma confirmation dialog; lock / sleep / settings / app-store entries unaffected.