Skip to main content

Module needs

Module needs 

Source
Expand description

The day’s needs, set first: meals, naps and night sleep (docs/health.md, “Meals, rest and sleep”). Their times are kept free: the plan lays no task in them (plan::Settings::with_needs), the day shows meals and naps, and two notices come for each, at most: a heads-up about the work a quarter of an hour before (“No new big task”), then one at the time. Any day can differ from the usual one: a block moved, its times changed, quiet, taken out, or one added for that day only (Days, shared with your devices). Nothing about eating or sleeping is recorded, and nothing is said when one passes.

From the literature on eating disorders and irregular eating (notes in docs/research/meal-prompts.md): by the clock, at times the person sets, never by hunger (CBT-E, Murphy et al. 2010; NICE NG69); every part set by the person, per block (Lindgreen, Lomborg & Clausen 2018); neutral words, no praise, no numbers, no “missed” (Eikey 2021; Levinson et al. 2017); the heads-up about the work, so it can be left on time (Leroy & Glomb 2018); naps with time to wake up after (Hilditch et al. 2017); sleep with a wind-down before it (Harvey et al. 2021).

Structs§

Alarm
The alarm at the end of a night (Needs::alarm_of).
Block
A time kept free, again and again: a meal or a nap.
DayBlock
One block on one day: a usual one changed that day only, by its key (“meal:1”, “nap:0”; “sleep”, the night starting that evening), or one added that day only (“added-…”), its kind said (docs/health.md, “Meals, rest and sleep”). Times on the clock and as set: a usual time changed later moves the usual days, never this one.
DayEdit
What a day’s block is asked to become, that day only, as the Health page asks it (Needs::change_day).
Days
Each day’s changes, by day: $XDG_DATA_HOME/sioul/health-days.toml, shared with your own devices as the health file is (the sharing’s health part). Days more than two weeks past are dropped.
Kept
One time kept free on a day.
Needs
Meals, naps and the night, each kind on or off; three meals when meals are first turned on, one of them in the evening (Murphy et al. 2010).
Sleep
The night: from winding down to waking up.
Today
The notices given today, on this device only, never shared ($XDG_STATE_HOME/sioul/needs-today.toml). Nothing about eating or sleeping itself. The day’s moves and skips live with each day’s changes now (Days); those an older Sioul wrote here are read once, to move them there.

Enums§

DayProblem
Why a day’s block was left as it was.

Constants§

DAYS_HEADER 🔒
What a person reads first in the days’ file.
KEPT_DAYS 🔒
How long a past day’s changes are kept: two weeks.
WAKINGS_AHEAD_DAYS
How many days ahead a phone is given its alarms at waking.

Functions§

a_nap 🔒
an_hour 🔒
at 🔒
date at time in zone, Unix seconds (a time skipped by a change of hour, after it).
clock 🔒
at (Unix seconds) on the clock in zone: “12:30”.
every_day 🔒
hh_mm 🔒
“8:5” as typed, “08:05” as kept.
is_added
Whether a block’s key names one added for a day only.
none_ticked 🔒
quarter 🔒
three_meals 🔒
time_of 🔒
“18:30” → 18:30.
yes 🔒