diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-19 18:23:29 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-19 18:23:29 +0200 |
| commit | eba0c13ad2f50964b6f88950366cb659c0d8b055 (patch) | |
| tree | 4d26bb384def848a673dd5e469a2aeed8dc1b476 /desktop/modules/status/README.md | |
| parent | ae9636030bb46db6a42dba59ea3fcbf64e541ffe (diff) | |
| download | quickshell-eba0c13ad2f50964b6f88950366cb659c0d8b055.tar.gz quickshell-eba0c13ad2f50964b6f88950366cb659c0d8b055.zip | |
feat(status): auto-present while a game runs
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.
Diffstat (limited to 'desktop/modules/status/README.md')
| -rw-r--r-- | desktop/modules/status/README.md | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/desktop/modules/status/README.md b/desktop/modules/status/README.md index 87654d5..e043dcd 100644 --- a/desktop/modules/status/README.md +++ b/desktop/modules/status/README.md @@ -1,13 +1,16 @@ # status Desktop modes as state: `dnd`, `presentation` and `nolock`, owned by the -`Status` singleton and stored as files under `$XDG_RUNTIME_DIR`. +`Status` singleton and stored as files under `$XDG_RUNTIME_DIR`. A fourth, +`status.gaming`, is written only by the shell's game detector; it is not a +mode `statusctl` exposes. ## The files are the interface $XDG_RUNTIME_DIR/status.dnd $XDG_RUNTIME_DIR/status.presentation $XDG_RUNTIME_DIR/status.nolock + $XDG_RUNTIME_DIR/status.gaming Each holds `0` or `1`; a missing file means off. That directory is tmpfs, so a reboot resets every mode and there is no cleanup code. A shell restart does @@ -95,6 +98,29 @@ toward `activeCount`: a running daemon is not a mode the user switched on. The daemon's own configuration lives in `~/.config/breaktimer.conf` and is not edited from here; `breaktimer.sh config` prints what is in effect. +## Game detection + +Presentation is set automatically while a game runs, so a fullscreen game does +not get locked or interrupted by the idle timer, DND or breaktimer. The shell +polls every five seconds for a `gamescope` process or a running Steam binary, +and either one is enough: + + pgrep -x gamescope || pgrep -f 'steamapps/commo[n]' + +The steam pattern is bracketed so it cannot match the check's own command +line: `pgrep -f` reads the whole argv, and a literal `steamapps/common` would +match the `sh` running the check and report a game forever. + +The result is written to `status.gaming`, a file separate from +`status.presentation`, and presentation is the OR of the two. That separation +is the point: a game ending clears only the gaming half, so a presentation the +user set by hand survives for the whole game session instead of being clobbered +on exit. It also means presentation cannot be turned off by hand while a game +runs, since `status.gaming` holds it on until the game exits. + +`status.gaming` is never set by `statusctl`; the detector owns it. The effects +are unchanged, because they key off the combined `presentation` value. + ## Waybar `custom/presentation` reads `statusctl presentation watch`. It replaces |
