From e81c248c6243719f62b426dd68b0a74dc5b912d8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 17 Sep 2026 14:39:06 +0200 Subject: fix(status): read a missing state file as off, not down 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. --- desktop/modules/status/statusctl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'desktop/modules/status/statusctl') diff --git a/desktop/modules/status/statusctl b/desktop/modules/status/statusctl index 6fbb689..8877ff3 100755 --- a/desktop/modules/status/statusctl +++ b/desktop/modules/status/statusctl @@ -82,12 +82,14 @@ tooltip() { case "$1" in activated) printf '%s: on' "$mode" ;; deactivated) printf '%s: off' "$mode" ;; - down) printf '%s: no state file' "$mode" ;; esac } +# A missing file is the off state, not a distinct condition: read_mode already +# reads it as 0, and this is the same path `get` uses. There is no "down": a +# file cannot report whether a watcher is alive, and a missing one is exactly +# what a fresh session looks like. state_now() { - [[ -e "$file" ]] || { printf 'down'; return; } [[ "$(read_mode)" == "1" ]] && printf 'activated' || printf 'deactivated' } -- cgit v1.2.3