aboutsummaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/modules/status/README.md28
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