repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(quickshell): report failed osd actions

2a46ca6e1df5d87f76048b3b862ed360f8447dfe

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

docs/super/inventory/2026-06-17-quickshell-phase-4e-osd-failure-handling-verification.md

Added
new file mode 100644
1 +# Quickshell Phase 4E OSD Failure Handling Verification — 2026-06-17
3 +## Scope
5 +Hardened OSD action IPC wrappers so failed external commands do not look like successful OSD actions. This matters for media/capture/color parity because those wrappers depend on external programs and live session state.
7 +## Implemented files
9 +- `quickshell/nugu/Commands.qml`
10 +- `quickshell/nugu/README.md`
12 +## Change
14 +Before this change, fixed-message wrappers set `lastOsdAction` to the intended success label before the process completed. If `playerctl` or another external command failed, `lastOsdAction` could still look successful.
16 +Now wrappers set a pending value first and update to:
18 +```text
19 +failed <action>
20 +```
22 +when the external process exits nonzero.
24 +## Verification
26 +Temporary `XDG_CONFIG_HOME` named config was used; no live home symlink mutation.
28 +Commands:
30 +```sh
31 +qs ipc -c nugu call nugu osdReloadHypr
32 +qs ipc -c nugu call nugu lastOsdAction
33 +qs ipc -c nugu call nugu osdMediaToggle
34 +qs ipc -c nugu call nugu lastOsdAction
35 +```
37 +Observed:
39 +```text
40 +reload=Hyprland reloaded
41 +last_reload=Hyprland reloaded
42 +media=Play/pause
43 +last_media=failed Play/pause
44 +```
46 +This is expected because no live MPRIS player is available in the validation session. Reload still succeeds and shows the intended OSD.
48 +Runtime output:
50 +```text
51 +INFO: Configuration Loaded
52 +```
54 +No QML errors, binding loops, reference errors, annotation warnings, or lingering `qs` process were observed.
56 +Screenshot:
58 +- `/tmp/nugu-qs-osd-fail-reload.png`
60 +## Boundary
62 +- This does not prove media parity; it proves failed media commands are observable instead of silently treated as success.
63 +- Media parity still needs a live MPRIS player.
64 +- Capture/color wrappers still need interactive validation.

quickshell/nugu/Commands.qml

Modified
14 14 property string lastPowerAction: ""
15 15 property string lastOsdAction: ""
16 16 property string nextOsdTone: "info"
17 + property string pendingOsdAction: ""
17 18 property bool executeConfirmedPowerActions: false
19 20 signal osdRequested(string message, string tone)
26 27 function shellOsd(command: string, fallback: string, tone: string): string {
27 28 // Shell snippets mirror the current Hypr OSD helpers. They stay behind
28 29 // this boundary so Hypr Lua can later shrink to stable Quickshell IPC.
29 - lastOsdAction = fallback
30 + lastOsdAction = `pending ${fallback}`
31 + pendingOsdAction = fallback
30 32 nextOsdTone = tone
31 33 osdProcess.command = ["sh", "-c", `(${command}) >/dev/null && printf '%s' "${fallback}"`]
32 34 osdProcess.running = true
36 38 function shellOsdOutput(command: string, tone: string): string {
37 39 // Dynamic controls print their final status message; the collector turns
38 40 // that into a Nugu OSD instead of `hyprctl notify`.
39 - lastOsdAction = command
41 + lastOsdAction = "pending"
42 + pendingOsdAction = command
40 43 nextOsdTone = tone
41 44 osdProcess.command = ["sh", "-c", command]
42 45 osdProcess.running = true
155 158 Process {
156 159 id: osdProcess
160 + onExited: (exitCode, exitStatus) => {
161 + if (exitCode !== 0) root.lastOsdAction = `failed ${root.pendingOsdAction}`
157 163 stdout: StdioCollector {
158 164 onStreamFinished: {
159 165 const message = this.text.trim()

quickshell/nugu/README.md

Modified
181 181 `osdSessionSuspendDryRun` records the sleep action and shows the OSD, but does
182 182 not suspend. Capture/color IPC uses the existing external tools and must be
183 -validated interactively before bind migration.
183 +validated interactively before bind migration. `lastOsdAction` reports
184 +`failed ...` when an external OSD command exits nonzero, so missing media players
185 +or failed capture commands do not look like verified success.