Skip to main content

Module notify

Module notify 

Source
Expand description

The one exception to the admin windows: a quiet desktop notification for a verified code, with the code in it (docs/porch.md, “Right now”); a gentle reminder; new mail at the times it may come, once per batch (docs/porch.md, “Notifications”); and the time running, while a focus session runs (docs/tasks.md).

Structs§

Ongoing
The notification of something going on, the time running while a focus session runs (docs/tasks.md): shown until it is closed, changed in place, its buttons pressed any number of times. Its own thread holds the D-Bus connection that shows it, and listens there: the server tells a press to that connection alone (Plasma addresses it). Resident, kept when a button is pressed; at normal urgency, for Plasma shows a low one nowhere unless told to; without sound. A server that keeps what it shows (“persistence”: its history, its tray) takes it there after its popup, buttons alive; elsewhere it does not expire. No session bus, no server: nothing shows, nothing breaks. Dropped, it is taken away.
Said 🔒
What a lasting notification says: its buttons as (key, label), “default” for a click on it.

Enums§

Change 🔒
Heard 🔒
What the server said, read between two looks.

Constants§

ASKED_AGAIN 🔒
A notification the server did not take (one starting with the session, after Sioul) is asked again this often.
BUNDLE_ID
Sioul’s bundle id on macOS, as packaging/macos/Info.plist names it (CFBundleIdentifier). macOS shows a notification as coming from the application whose id it is given; without one, notify-rust’s macOS side (mac-notification-sys) names another application.
DESKTOP_ENTRY 🔒
Sioul’s desktop file, named on each notification (“desktop-entry”): the desktop knows them as Sioul’s, and lists Sioul in its notification settings (Plasma’s “Show in do not disturb mode”, for the doses during a pause: docs/pauses.md).
LISTENED 🔒
How long a lasting notification’s thread listens to the server before it looks at what Sioul asked: a change shows within it.
SERVER 🔒
The notification server, on the session bus.
SERVER_PATH 🔒
SHOWN 🔒
How long the notification stays: about the life of a code.

Functions§

body_text 🔒
A body as the notification server reads it. Most read markup there (“body-markup”: <b>, <a href>, <img src>), and bodies carry a mail’s or a site’s words: there, &, < and > are written as entities, so that the words show as they came and nothing in them is a link or a picture to fetch. A server that reads no markup shows the text as it is. The summary is plain text for every server (the specification), and goes as it is.
build 🔒
close_lasting 🔒
code
Shows a code: title says what and from whom, body the code and how long it lasts. No sound. With copy, the notification offers a button labelled with its text, and its action runs when the button is pressed; the notification then lives on its own thread, which waits for the button.
mail
New mail at the times it may come (docs/porch.md, “Notifications”): one notification for the batch, no sound, with one button (“Open”: the Porch) whose action runs when pressed. At normal urgency, unlike codes and reminders: the desktop’s own do-not-disturb holds it; but at critical urgency when someone Always through is in it (through), which passes it (docs/attention.md, Q10).
ongoing
Shows the notification of something going on. actions are its buttons as (key, label), “default” for a click on it; on_action runs with the key of each one pressed, on the notification’s own thread.
remind
A gentle reminder (a dose to take): one notification, no sound, with one button whose action runs when pressed.
remind_choices
A gentle reminder with several buttons, each its label and its action: the one pressed runs (the night’s notice: “Close the day” and “Options…”).
serve 🔒
A lasting notification’s thread: what Sioul asks shown, what the server says heard, until it is taken away.
show_lasting 🔒
Shows it, in place of id if not 0: the server’s number for it.