repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(quickshell): add confirmed power menu

f8525cba45bedb1b8d0e5777beae29da74b5d356

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (5)

docs/super/inventory/2026-06-17-quickshell-phase-4d-power-verification.md

Added
new file mode 100644
1 +# Quickshell Phase 4D Power Confirmation Verification — 2026-06-17
3 +## Scope
5 +Added a standalone Quickshell power menu IPC surface. This is the future `CTRL+ALT+Delete` replacement for `hyprshutdown --dry-run` and the Ironbar power popup. Live Hypr binds are not migrated yet.
7 +## Implemented files
9 +- `quickshell/nugu/PowerMenu.qml`
10 +- `quickshell/nugu/Commands.qml` confirmed power boundary
11 +- `quickshell/nugu/shell.qml` IPC wiring
12 +- `quickshell/nugu/README.md` usage notes
14 +## Design decision
16 +The menu includes the current action set:
18 +- lock
19 +- sleep
20 +- logout / out
21 +- reboot
22 +- poweroff / off
24 +Actions are two-step through `requestPowerAction(...)` then `confirmPowerAction()`. Confirmed non-lock actions remain dry-run by default through `Commands.executeConfirmedPowerActions: false`. This prevents accidental logout/suspend/reboot/poweroff during validation and keeps destructive execution behind explicit future approval.
26 +## IPC tested
28 +Temporary `XDG_CONFIG_HOME` named config was used; no live home symlink mutation.
30 +```sh
31 +qs ipc -c nugu call nugu openPowerMenu
32 +qs ipc -c nugu call nugu powerMenuVisible
33 +qs ipc -c nugu call nugu requestPowerAction reboot
34 +qs ipc -c nugu call nugu pendingPowerAction
35 +qs ipc -c nugu call nugu confirmPowerAction
36 +qs ipc -c nugu call nugu lastPowerAction
37 +qs ipc -c nugu call nugu powerMenuVisible
38 +```
40 +Observed returns:
42 +```text
43 +open=open
44 +visible=true
45 +request=reboot
46 +pending=reboot
47 +confirm=dry-run reboot
48 +last=dry-run reboot
49 +visible_after=false
50 +```
52 +Safety check:
54 +```text
55 +pgrep -a systemctl | grep -E 'reboot|poweroff|suspend': empty
56 +```
58 +Runtime output:
60 +```text
61 +INFO: Configuration Loaded
62 +```
64 +No QML errors, binding loops, reference errors, or lingering `qs` process were observed.
66 +## Screenshots
68 +- `/tmp/nugu-qs-power-menu.png`
69 +- `/tmp/nugu-qs-power-confirm-reboot.png`
71 +Vision checks confirmed:
73 +- Nugu power menu shows `lock`, `sleep`, `out`, `reboot`, `off`.
74 +- Dry-run notice is visible and readable.
75 +- Reboot confirmation state shows `cancel` and `confirm reboot`.
76 +- Destructive/error styling is visible for reboot confirmation.
78 +## Still open before replacing `hyprshutdown`
80 +- Real keybind migration after Quickshell service is live/recoverable.
81 +- Decide with user when, if ever, `executeConfirmedPowerActions` may become true.
82 +- If enabled, verify logout/sleep/reboot/poweroff semantics carefully; destructive actions need explicit approval.

quickshell/nugu/Commands.qml

Modified
12 12 property string lastClipboardPreview: ""
13 13 property bool lastClipboardCopied: false
14 14 property string lastPowerAction: ""
15 + property bool executeConfirmedPowerActions: false
16 17 function detached(args: var): void {
17 18 runner.command = args
63 64 lastPowerAction = `dry-run ${action}`
67 + function confirmedPower(action: string): string {
68 + // Confirmation UI is live before destructive execution is allowed. The
69 + // execution switch stays false until full parity and user approval.
70 + if (!executeConfirmedPowerActions || action === "lock") {
71 + if (action === "lock") lock()
72 + else dryRunPower(action)
73 + return lastPowerAction
74 + }
76 + if (action === "sleep") detached(["sh", "-c", "loginctl lock-session && systemctl suspend"])
77 + else if (action === "logout") detached(["hyprctl", "dispatch", "exit"])
78 + else if (action === "reboot") detached(["systemctl", "reboot"])
79 + else if (action === "poweroff") detached(["systemctl", "poweroff"])
80 + else return "unknown"
82 + lastPowerAction = action
83 + return lastPowerAction
84 + }
66 86 Process { id: runner }
68 88 Process {

quickshell/nugu/PowerMenu.qml

Added
new file mode 100644
1 +import QtQuick
2 +import QtQuick.Layouts
3 +import Quickshell
4 +import Quickshell.Wayland
5 +import "."
7 +PanelWindow {
8 + id: root
10 + required property QtObject theme
11 + required property QtObject commands
12 + property bool open: false
13 + property string pendingAction: ""
15 + // This is the future CTRL+ALT+Delete target. It improves on hyprshutdown by
16 + // making destructive/session actions two-step while keeping execution gated.
17 + visible: open
18 + focusable: open
19 + anchors { top: true; left: true; right: true }
20 + margins { top: 96 }
21 + exclusiveZone: -1
22 + implicitHeight: 250
23 + color: "transparent"
25 + WlrLayershell {
26 + layer: WlrLayer.Overlay
27 + namespace: "nugu-power-menu"
28 + keyboardFocus: root.open ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
29 + }
31 + function show(): string {
32 + pendingAction = ""
33 + open = true
34 + return "open"
35 + }
37 + function close(): void {
38 + open = false
39 + pendingAction = ""
40 + }
42 + function request(action: string): string {
43 + pendingAction = action
44 + open = true
45 + return pendingAction
46 + }
48 + function confirm(): string {
49 + if (pendingAction.length === 0) return "none"
50 + const result = commands.confirmedPower(pendingAction)
51 + pendingAction = ""
52 + open = false
53 + return result
54 + }
56 + function label(action: string): string {
57 + if (action === "poweroff") return "power off"
58 + if (action === "reboot") return "reboot"
59 + if (action === "logout") return "log out"
60 + if (action === "sleep") return "sleep"
61 + if (action === "lock") return "lock"
62 + return "choose"
63 + }
65 + MouseArea {
66 + anchors.fill: parent
67 + onClicked: root.close()
68 + }
70 + Rectangle {
71 + anchors.top: parent.top
72 + anchors.horizontalCenter: parent.horizontalCenter
73 + width: Math.min(parent.width - 32, 480)
74 + height: parent.height
75 + radius: 14
76 + color: `${theme.ui.backdrop}f2`
77 + border.width: 2
78 + border.color: pendingAction === "reboot" || pendingAction === "poweroff" ? theme.error : theme.ui.accent
80 + ColumnLayout {
81 + anchors.fill: parent
82 + anchors.margins: 14
83 + spacing: 10
85 + Text {
86 + Layout.fillWidth: true
87 + text: pendingAction.length === 0 ? "Power" : `Confirm ${root.label(root.pendingAction)}`
88 + color: pendingAction === "reboot" || pendingAction === "poweroff" ? theme.error : theme.ui.important_global
89 + font.family: "IBM Plex Sans"
90 + font.pixelSize: 20
91 + font.bold: true
92 + horizontalAlignment: Text.AlignHCenter
93 + }
95 + Text {
96 + Layout.fillWidth: true
97 + text: commands.executeConfirmedPowerActions
98 + ? "Confirmed action will execute."
99 + : "Confirmed non-lock actions are dry-run until parity approval."
100 + color: theme.ui.minor
101 + font.family: "IBM Plex Mono"
102 + font.pixelSize: 12
103 + horizontalAlignment: Text.AlignHCenter
104 + wrapMode: Text.WordWrap
107 + GridLayout {
108 + Layout.fillWidth: true
109 + columns: 2
110 + rowSpacing: 8
111 + columnSpacing: 8
112 + visible: pendingAction.length === 0
114 + StatusItem { theme: root.theme; text: "󰌾 lock"; minWidth: 210; onLeftClicked: root.request("lock") }
115 + StatusItem { theme: root.theme; text: "󰤄 sleep"; minWidth: 210; muted: true; onLeftClicked: root.request("sleep") }
116 + StatusItem { theme: root.theme; text: "󰍃 out"; minWidth: 210; muted: true; onLeftClicked: root.request("logout") }
117 + StatusItem { theme: root.theme; text: "󰜉 reboot"; minWidth: 210; critical: true; onLeftClicked: root.request("reboot") }
118 + StatusItem { theme: root.theme; text: "󰐥 off"; minWidth: 210; critical: true; onLeftClicked: root.request("poweroff") }
121 + RowLayout {
122 + Layout.fillWidth: true
123 + visible: pendingAction.length > 0
124 + spacing: 8
126 + StatusItem {
127 + theme: root.theme
128 + text: "cancel"
129 + minWidth: 210
130 + onLeftClicked: root.pendingAction = ""
133 + StatusItem {
134 + theme: root.theme
135 + text: `confirm ${root.label(root.pendingAction)}`
136 + minWidth: 210
137 + critical: root.pendingAction === "reboot" || root.pendingAction === "poweroff"
138 + warning: root.pendingAction === "sleep" || root.pendingAction === "logout"
139 + onLeftClicked: root.confirm()
145 + Shortcut {
146 + sequence: "Escape"
147 + onActivated: root.close()

quickshell/nugu/README.md

Modified
136 136 qs ipc -c nugu call nugu chooseClipboardIndex 0
137 137 qs ipc -c nugu call nugu closeClipboardPicker
140 +## Phase 4D power confirmation IPC
142 +Phase 4D adds the future `CTRL+ALT+Delete` target. The menu has the same action
143 +set as the current power surfaces but makes session/destructive actions two-step.
144 +Confirmed non-lock actions remain dry-run until final parity approval.
146 +```sh
147 +qs ipc -c nugu call nugu openPowerMenu
148 +qs ipc -c nugu call nugu requestPowerAction reboot
149 +qs ipc -c nugu call nugu pendingPowerAction
150 +qs ipc -c nugu call nugu confirmPowerAction
151 +qs ipc -c nugu call nugu lastPowerAction
152 +qs ipc -c nugu call nugu closePowerMenu
153 +```

quickshell/nugu/shell.qml

Modified
84 84 function clipboardPickerMatchCount(): int { return clipboardPicker.matchCount() }
85 85 function clipboardPickerFirstPreview(): string { return clipboardPicker.firstMatchPreview() }
86 86 function chooseClipboardIndex(index: int): string { return clipboardPicker.chooseIndex(index) }
88 + // Power IPC is the future CTRL+ALT+Delete target. Non-lock actions keep
89 + // dry-run semantics after confirmation until explicit parity approval.
90 + function openPowerMenu(): string { return powerMenu.show() }
91 + function closePowerMenu(): void { powerMenu.close() }
92 + function powerMenuVisible(): bool { return powerMenu.open }
93 + function requestPowerAction(action: string): string { return powerMenu.request(action) }
94 + function pendingPowerAction(): string { return powerMenu.pendingAction }
95 + function confirmPowerAction(): string { return powerMenu.confirm() }
96 + function lastPowerAction(): string { return commandBus.lastPowerAction }
89 99 Loader {
110 120 commands: commandBus
123 + PowerMenu {
124 + id: powerMenu
125 + theme: nuguTheme
126 + commands: commandBus
113 129 // Create one bar per monitor, matching Ironbar's multi-output behavior.
114 130 Variants {
115 131 model: Quickshell.screens