Skip to main content

Module dnd

Module dnd 

Source
Expand description

Do-not-disturb during the two pauses, “Paused” and “Free time” (docs/pauses.md, “Do-not-disturb”; the research behind it: docs/research/emergency-pause.md, 7 and P7–P10), and for Sioul’s own do-not-disturb on every device (Which::Global: its switch, the focus timer, sleep). Sioul holds its own notifications itself; here, the system’s do-not-disturb, with exceptions set beforehand, where the system lets an application set it, and a sentence saying what was silenced and what could not be.

  • Android: a mode of Sioul’s own for each (“Pause”, “Free time”, “Do not disturb (Sioul)”), letting through what the matrix of what reaches you lets through then, as far as Android can say it (Ask::silence: calls and messages from nobody, starred contacts, contacts or anyone, repeat callers, priority conversations), alarms, and Sioul’s dose reminders and an event’s alarms on channels that pass (android/package/src/com/aurelienpierre/sioul/PauseMode.java). Needs Android’s “Do Not Disturb access”.
  • Plasma: its notification server’s inhibition, held while the pause lasts (sioul-sync’s dnd.rs); it ends with Sioul’s process.
  • GNOME: only the person’s own switch exists; Sioul turns it on and off again only with their yes, given in the pause’s settings.
  • macOS: the person’s own shortcuts. Windows: nothing an application may do.

Never turns off a do-not-disturb the person set while Sioul’s holds: only what Sioul turned on is turned off then. Asked again unchanged, nothing is redone (the pauses ask each minute); what was turned on is kept in the state folder (dnd.toml), so that a crash is healed at the next start.

Both ways (docs/do-not-disturb.md): each system’s own do-not-disturb is read (Platform::system_on) and followed (listen: Plasma’s Inhibited, GNOME’s switch; Android’s receiver in Java), and when Sioul’s goes off on this device, the system’s own is turned off too where Sioul can (system_off: Android 12 to 14, Plasma’s own, GNOME’s with the person’s yes), or said (still_on). A switch “on” taken from this device’s own system adds no mode of Sioul’s over it (Ask::stack).

Modules§

answers 🔒
Android’s answers (PauseMode.java), as facts. Compiled everywhere: tested on a computer.
desktop 🔒
The desktop’s logic, compiled where it runs and for the tests; the session itself (D-Bus, gsettings, Plasma’s files) only where it runs.

Structs§

Ask 🔒
What a pause asks of the system, as set beforehand in its settings.
Done 🔒
What a platform did or can do, as facts.
Kept 🔒
What Sioul turned on, kept in the state folder for the next run.
Layer 🔒
The logic: what is on, what was said, what the next run must know.
Report 🔒
What was done, in words for the screen.

Enums§

Doses 🔒
What becomes of a dose reminder during the pause, on the phone.
Said 🔒
A fact said on the pause’s line or in its settings; sentence words it.
Senders 🔒
Who gets through the phone’s mode, as Sioul sets it (attention::Senders).
Which 🔒
Which pause.

Constants§

MAC_OFF 🔒
MAC_ON 🔒
The macOS shortcuts the person makes, run at the start and the end.

Statics§

LAYER 🔒

Traits§

Platform 🔒
One system’s side, behind a trait: the logic below is tested with a stand-in.

Functions§

again 🔒
“Silence this device again”: ask’s mode left and entered afresh, the person’s earlier “off” in the system set aside.
can 🔒
What the pause’s settings can show here, with no change made.
enter 🔒
The system’s do-not-disturb on for ask’s pause, or brought up to date when its settings changed. Asked again unchanged, nothing is redone.
kept_path 🔒
Where what Sioul turned on is kept.
leave 🔒
The do-not-disturb Sioul turned on for this pause, off again; nothing else. Asked again, or for a pause not on, nothing is done (but the first time in a run, which heals what a crash left).
lets 🔒
“calls from your contacts, messages from starred contacts, repeat callers and priority conversations”: what a phone’s mode lets through.
listen 🔒
This system’s own do-not-disturb followed, each change heard as it happens told to told (Plasma’s Inhibited, GNOME’s switch); on Android, Java’s receiver hears it. Once, while the window runs.
offer_label 🔒
A label for one of Report::offers.
on_here 🔒
Whether Sioul’s do-not-disturb held on this device at the last apply; on, what holds now, kept for the next (in the state folder, across restarts).
open 🔒
One of Report::offers, opened: “access”, “starred”, “plasma”, “modes”.
open_access 🔒
Android’s page where Sioul is given “Do Not Disturb access” (Modes access from Android 15). Nothing elsewhere.
open_modes 🔒
Android’s own do-not-disturb settings, where the person turns it off (Sioul may not, from Android 15). Nothing elsewhere.
open_plasma 🔒
Plasma’s notification settings, at Sioul’s page (“Show in do not disturb mode”). Nothing elsewhere.
open_starred 🔒
The Contacts app’s starred list, which the person edits there: Sioul never writes stars. Nothing elsewhere.
read_kept 🔒
sentence 🔒
still_after_quit 🔒
Sioul quits on a computer: whether its system stays silenced without it (GNOME’s switch, a Mac’s Focus, which outlive Sioul); Plasma’s inhibitions end with Sioul’s process.
still_on 🔒
While Sioul’s do-not-disturb is off here: the system’s own still on, said (“… stays on: turn it off …”), with what may be opened; none when it is off.
system_off 🔒
Sioul’s do-not-disturb went off here: the system’s own off too, once, where Sioul can (consent: GNOME’s yes). Whether something was turned off.
take_pause_pressed 🔒
Android: “Pause” pressed on the quick-settings tile or the home screen’s shortcut since last asked (PauseOpener.java). False elsewhere.
tell_system 🔒
On Android, what Java keeps of Sioul’s do-not-disturb here: its state (the tile, the receiver’s filter); nothing elsewhere.
with 🔒
yes 🔒

Type Aliases§

System 🔒
Told 🔒
A change of a system’s own do-not-disturb, heard as it happened: on or off.