diff options
Diffstat (limited to 'desktop/modules/mail')
| -rw-r--r-- | desktop/modules/mail/README.md | 67 |
1 files changed, 25 insertions, 42 deletions
diff --git a/desktop/modules/mail/README.md b/desktop/modules/mail/README.md index ced87f3..b6a3159 100644 --- a/desktop/modules/mail/README.md +++ b/desktop/modules/mail/README.md @@ -7,8 +7,8 @@ > `blur-mail` namespace in the Theme section below is historical, since this > page now rides the drawer's `quickshell-desktop` surface. -Unread mail across every account, as one waybar number and a drawer behind it. -Clicking the icon opens the drawer; Escape or a click outside closes it. +Unread mail across every account, as a tile and a page in the drawer. +Opening the page shows the accounts; Escape or a click outside closes it. ┌──────────────────────────────────────────────────┐ │ Mail 33 unread │ @@ -33,12 +33,12 @@ Clicking the icon opens the drawer; Escape or a click outside closes it. qs -p ./desktop It is started from `autostart.lua` and reached over IPC, so the shell has to be -running for the waybar click to do anything: +running for a deep link to do anything: qs -p ./desktop ipc call drawer open mail -Write that path out in full in the real config. Waybar's `exec` and `on-click` -have no shell to expand `~`, and neither do Hyprland's Lua strings. +Write that path out in full in the real config. Hyprland's Lua strings have no +shell to expand `~`. ## The accounts are not listed here @@ -77,7 +77,7 @@ account with `path:"<maildir>/**"`, and copying that query would be wrong for this panel. notmuch deduplicates by message id, so a message that arrived at two of the configured addresses is one message with two file paths: a glob counts it under both accounts, and the rows then sum to more than the total the -waybar icon shows. Measured here, five accounts summed to 102 against a global +header shows. Measured here, five accounts summed to 102 against a global total of 101. The tag is a property of the message, so it is singular and the rows always sum to the header. The cost is that such a message appears under only the account the `post-new` hook attributed it to, which is the right trade @@ -104,35 +104,18 @@ An unknown count shows a dash, never a zero, for the same reason the VM panel refuses to substitute libvirt's host-side figures: a number that is actually a failure reads as a fact. -## The waybar module +## The count -A `custom` module in **continuous mode**: the script never exits, prints one -JSON line per database commit, and waybar redraws on each line. There is no -`interval`, and no daemon to supervise, because waybar owns the process. +The drawer's `Accounts.qml` watches the xapian directory itself, so the count +drops the moment mail is read in qtmaildir and rises the moment mbsync commits. +The count lives only in the drawer: the old bar module is gone with waybar. - "custom/mail": { - "format": "<span font='18px'></span> {}", - "return-type": "json", - "exec": "~/Programming/GIT/quickshell/desktop/modules/mail/waybar-mail.sh", - "on-click": "qs -p ~/Programming/GIT/quickshell/desktop ipc call drawer open mail", - "on-click-right": "~/bin/mailsync.sh", - "tooltip": false - } - -The count drops the moment mail is read in qtmaildir and rises the moment -mbsync commits, because both write the database and the watcher sees either. - -Two details in that loop are load-bearing. The watch is on the **xapian -directory**, not on a file inside it: a commit replaces files, and a watch held -on a filename dies with it. And a short sleep coalesces the several writes of -one commit, without which the module redraws three or four times per sync with +Two details in the watch are load-bearing. It is on the **xapian directory**, +not on a file inside it: a commit replaces files, and a watch held on a +filename dies with it. And a short debounce coalesces the several writes of one +commit, without which the page redraws three or four times per sync with intermediate counts. -The old setup this replaces ran three copies of a python script polling the -Gmail API with stored credentials, covered three of the five accounts, and -opened Thunderbird. Everything it fetched over the network was already in the -local index. - ## Notifications on arrival `mail-notify.sh` sends one notification per account when mail lands, with the @@ -143,10 +126,9 @@ Started from `autostart.lua`, it runs for the whole session. /home/you/Programming/GIT/quickshell/desktop/modules/mail/mail-notify.sh -It watches the same xapian directory the waybar module does, for the same -reason and with the same 0.3s debounce. It is a **separate process rather -than part of `waybar-mail.sh`**, which already has that edge: waybar owns -that script's process, so a bar restart would stop notifications with nothing +It watches the same xapian directory `Accounts.qml` does, for the same reason +and with the same 0.3s debounce. It is a **separate process rather than part of +the shell**, so a shell restart does not stop notifications with nothing reporting it. **A commit is not the same as new mail.** Reading a message in qtmaildir drops @@ -171,7 +153,7 @@ from the old one means nothing. revision and notifying nothing. Without that floor, `lastmod:0..` matches every unread message ever: 101 of them here, which is a wall of popups at every login. The same applies to a restart, so mail that arrived while it was down is -never notified. The waybar count is still right and the drawer still shows it, +never notified. The drawer count is still right and still shows it, so nothing is lost but a stale popup. The notification is sent with dunstify. The icon is passed as an **absolute @@ -197,10 +179,12 @@ anchored to its top right, which is the idiom the vm and appearance panels both use and what gives click-outside-to-close and a focusable item for Escape. It differs from those two in one property: `exclusionMode` is `Normal`, not -`Ignore`. Waybar claims an exclusive zone at the top of this screen, so -respecting it places the overlay below the bar with no height constant here to -drift. Measured: waybar at `y=-540 h=42`, this overlay at `y=-498 h=1038`, -starting exactly where the bar ends. The backdrop therefore never dims waybar. +`Ignore`. Waybar claimed an exclusive zone at the top of this screen, so +respecting it placed the overlay below the bar with no height constant here to +drift. Measured then: waybar at `y=-540 h=42`, this overlay at `y=-498 h=1038`, +starting exactly where the bar ended. Waybar is gone, so the overlay now starts +at the top edge of the screen; `Normal` stays, so a bar added later is still +respected. **Key events reach a focused item, not a window.** Setting `WlrLayershell.keyboardFocus` is necessary but not sufficient, and @@ -219,8 +203,7 @@ possibly running client. "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. +and `~/bin/mailsync.sh` is a manual pull. ## The watcher status dot |
