aboutsummaryrefslogtreecommitdiffstats
path: root/mail-overview/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'mail-overview/README.md')
-rw-r--r--mail-overview/README.md36
1 files changed, 33 insertions, 3 deletions
diff --git a/mail-overview/README.md b/mail-overview/README.md
index daf2bf9..68ad051 100644
--- a/mail-overview/README.md
+++ b/mail-overview/README.md
@@ -16,7 +16,9 @@ Clicking the icon opens the drawer; Escape or a click outside closes it.
│ ● Account D 0 │
│ ● Account E 0 │
├──────────────────────────────────────────────────┤
- │ [Sync now] [Open qtmaildir] │
+ │ ● watcher ok · 25 folders │
+ ├──────────────────────────────────────────────────┤
+ │ [Open qtmaildir] │
└──────────────────────────────────────────────────┘
## Running it
@@ -145,8 +147,36 @@ open. `startup_account` in its config is a static setting, not a flag, so
here was rejected rather than deferred: it would write the database behind a
possibly running client.
-"Sync now" runs `~/bin/mailsync.sh`, which is already lock-protected against a
-concurrent cron run, and the watcher picks up whatever it commits.
+"Open qtmaildir" launches the client. There is no "Sync now" button: the
+watcher triggers a sync the moment mail lands, the cron tick is the backstop,
+and `on-click-right` on the waybar module runs `~/bin/mailsync.sh` for a manual
+pull.
+
+## The watcher status dot
+
+Below the accounts, above the button, a coloured dot reports whether
+`mail-watcher` is alive and sane, read from its heartbeat at
+`~/.local/state/mail-watcher.heartbeat`:
+
+- **green** (`watcher ok · N folders`) heartbeat fresh, no dead threads.
+- **yellow** (`N folder(s) dead, check the log`) heartbeat fresh, but a folder
+ gave up permanently.
+- **red** (`watcher not running`) heartbeat missing, unparseable, or older than
+ 300s.
+
+Backoff never turns the dot: it is normal recovery from a dropped IDLE
+connection, and the watcher's own health check treats it as healthy. The
+staleness rule is the same one `mail-watcher` uses (`heartbeat_is_healthy`),
+reimplemented here in a few lines rather than shelling out to
+`mail-watcher.py --status` on every open.
+
+The heartbeat is read once per open. The drawer is a `LazyLoader`, so closing
+and reopening rebuilds the `FileView` and reads the file current. A file watch
+is deliberately not used: the heartbeat is written by atomic replace (tmpfile
+then rename), so an inotify watch held on the old inode dies with it, which is
+the same trap as watching a file inside the Xapian directory. The cost is that
+a drawer left open does not update until reopened, which for 60s heartbeat data
+is not worth a timer.
## Theme and blur