aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/status
AgeCommit message (Collapse)AuthorFilesLines
12 daysfeat(status): report a running game as its own presentation stateDanilo M.3-3/+92
status.gaming is written by the shell's game detector and presentation is the OR of it and the manual file, but statusctl read only the manual half. A game therefore asserted the presentation effects while the waybar pill still read deactivated. Report gaming as a third state, for presentation only. The watch follows status.gaming as well as its own file, and emits only on a real change so an unchanged rewrite draws nothing. Toggle is refused while a game holds the mode: the detector reasserts the file within its poll, so the write would not stick. set stays allowed, the manual half is worth setting for when the game exits. gaming stays out of MODES. The detector owns that file and nothing here may write it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
12 daysfeat(status): detect PCSX2 for game modeDanilo M.1-3/+3
PCSX2 joins gamescope, Steam and DuckStation in the game detector, so presentation is set automatically while a PS2 game runs and the idle lock, DND and breaktimer stay out of the way. The binary is /usr/bin/pcsx2-qt, the same -qt shape as duckstation-qt, so it takes the same pgrep -x exact name match and cannot self-match the way the bracketed steam pattern has to guard against. Verified against the real emulator rather than a stand-in: with pcsx2-qt running, status.gaming reads 1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
14 daysfeat(status): auto-present while DuckStation runsDanilo M.1-4/+6
Game detection probed only gamescope and Steam, so a standalone DuckStation session never turned presentation on. Add a third probe for the duckstation-qt process. pgrep -x rather than the bracketed pgrep -f the Steam path needs: this is an exact match on the process name, so it cannot match the sh running the check, and the binary name is under the 15 character comm limit so it is not truncated.
2026-09-19feat(status): auto-present while a game runsDanilo M.1-1/+27
Presentation is worth having automatically while a game runs: it is a fullscreen app that already holds the screen, and the idle lock, DND and breaktimer are all unwanted during it. Detection is a 5s poll for a gamescope process or a Steam game binary, either one enough. The Steam pattern is bracketed so pgrep -f cannot match the sh running the check and report a game forever. The result goes to its own status.gaming file, and presentation becomes the OR of it and status.presentation. That separation is the point: a game ending clears only the gaming half, so a presentation set by hand survives a game session instead of being clobbered on exit.
2026-09-18docs(status): list stopped in the phase domainDanilo M.1-1/+1
2026-09-18docs(status): document the breaktimer read directionDanilo M.1-3/+41
The one rule worth writing down is which side writes: the daemon owns its files and the shell only calls verbs.
2026-09-18feat(status): show the breaktimer countdown on the tileDanilo M.1-1/+8
Below every mode in the priority chain, so an active mode still owns the line and breaktimer replaces only the idle 'All clear'. It does not count toward activeCount. A running breaktimer is not a mode the user switched on, and accenting the tile for an ordinary working day would read as a mode stuck on.
2026-09-18feat(status): a breaktimer row in the status pageDanilo M.2-0/+104
Into the status module rather than a module of its own: break state is one more thing the desktop is doing, which is what that page already is, and Status.qml was already where breaktimer.sh is called from. The paused state shows no number. The countdown is frozen while paused and a frozen number reads as a bug, so the row says what it is instead.
2026-09-18feat(status): add a screen lock modeDanilo M.6-6/+151
dnd and presentation were the only modes, and presentation was the sole holder of the Wayland idle inhibitor. That inhibitor is the only thing that stops hypridle's loginctl lock-session at the 600s timeout, so screen locking is on by default and there was no way to turn it off on its own. nolock is stored as "auto-lock disabled" so the file keeps the registry's "missing means off" rule, and the row inverts it so the switch reads as the default: lock on. Presentation now drives nolock the same way it drives dnd, holding the prior value in memory and restoring it on exit, so it needs no second inhibitor and the inhibitor has a single holder. The page sets the disable permanently or for a number of minutes. The deadline and its timer live in the singleton rather than the row because the drawer page is destroyed on close while the effect has to outlive it. The timer is shell-lifetime, the same class of limit as dndBeforePresentation: a restart during a timed disable leaves the lock off until it is toggled, which is safe because the user opted into the disable. The mode governs idle-triggered locking only. The SUPER+l bind and the lock on suspend are separate paths and stay live.
2026-09-17fix(status): read a missing state file as off, not downDanilo M.3-5/+9
statusctl watch reported class "down" for a missing state file and waybar's presentation rule drew a warning for it. That fires on every fresh session, before anything has written a file, which is the normal off state the registry's own invariant describes. The state was meant to flag a dead registry, but a crashed shell leaves a stale present file, not a missing one, so it never caught that case. get already read a missing file as 0; watch now matches it and the down state is gone.
2026-09-15feat(status): add the snooze rowDanilo M.2-0/+124
A switch and a free-text minutes field driving notify-snooze.sh. Snooze is a file the balloon shell reads, so the row only writes it; the switch follows the file, including a snooze that ends while the page is open.
2026-09-15fix(status): address final review findingsDanilo M.4-6/+7
F1: after a click the shared Switch writes checked directly, dropping StatusRow's declarative binding, so an external mode change from waybar or statusctl no longer moved the switch. Resync via onValueChanged. F2: the spec claimed hyprctl clients counts idle inhibitors, which is false for a layer-surface inhibitor; replace with the behavioral hypridle marker check. F3: README said the check covers both watch states; it exercises the activated report and the absent-file down report. F4: give breakProc an onExited check so a failed breaktimer.sh verb is visible instead of silent. F5: drop StatusTile's unused required st property and its injection. F6: comment the startup-order limit on dndBeforePresentation.
2026-09-15docs(status): document the module and record its trapsDanilo M.1-0/+59
A FileView fires its own fileChanged on setText, so a handler that writes in response to a change loops unless it compares first. IdleInhibitor has no window of its own and does nothing without one, so the singleton is handed the keepalive window by shell.qml. Both were read from the documentation while designing and confirmed while implementing.
2026-09-15fix(desktop): keep statusctl quiet when the mode file is absentDanilo M.1-6/+6
read_mode() failed on a missing mode file with a shell redirection error, 'statusctl: line 56: .../status.dnd: No such file or directory', printed to stderr on every get/toggle before the file existed and polluting waybar's exec stderr. The '2>/dev/null' sat on the 'tr' command, but the error is the parent shell's input redirection failure, which that redirect cannot suppress. Guard on '[[ -e "$file" ]]' before reading; a missing file still reads as 0, which was always the contract. Mirror the fix into the plan so plan and script agree.
2026-09-15feat(desktop): add the status page and register the moduleDanilo M.1-0/+43
One row per mode. Adding a mode is one file in the singleton and one row here, which is what a registry buys over two separate toggles.
2026-09-15feat(desktop): add the status module, tile and rowDanilo M.3-0/+122
The module is thin because the singleton owns the modes: it is a tile and a page over Status, always active so the effects hold whether or not the drawer has been opened. Injected as st rather than mod, since a component property named the same as the enclosing object's id binds to itself and arrives undefined.
2026-09-15feat(desktop): add the statusctl CLI and its checkDanilo M.2-0/+219
statusctl reads and writes the mode files directly rather than going through the shell, so it works while quickshell is down. Setting a mode that way records the state without firing its effects; the shell sees the change through its own watch and reasserts them. The watch listens on the directory, not the file: an atomic write replaces the file, so a watch held on the old inode dies with it. Same trap the mail watcher hit with Xapian, and the reason moved_to is in the event list. An unknown mode exits non-zero rather than reading as off, so a typo cannot masquerade as a mode that happens to be disabled. The watch loop runs inotifywait through process substitution, held open on fd 3, with the PID captured and trapped on EXIT/TERM/INT. Piped straight into the while loop, inotifywait would be a pipeline sibling rather than a child, so a plain kill on statusctl leaves it running, watching a directory nobody reads anymore. Task 7 wires this CLI into waybar's exec, and waybar kills and respawns exec children on every reload the same plain way, so every reload would otherwise leak another watcher for the rest of the session. Process substitution makes inotifywait a real child whose PID the trap can hold and kill. A SIGKILL still orphans it, since KILL cannot be trapped, but nothing in the described path sends one. A failed rename exits non-zero instead of being swallowed. Reporting success on a write that did not land would leave the caller and the shell disagreeing about the mode, with an orphan temp file as the only trace, and this script is the interface the whole registry is read and written through. Verified against an unwritable directory: exit 1, no orphan left, prior value intact. Reading uses a redirect rather than cat piped into tr, so that an unreadable file falling back to off is explicit rather than a side effect of a pipeline discarding cat's exit status. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7ThHHh5iTYbVfp3rNAkw2