pub struct Settings {Show 97 fields
pub micro_interval_secs: u64,
pub micro_duration_secs: u64,
pub long_interval_secs: u64,
pub long_duration_secs: u64,
pub micro_idle_reset_secs: u64,
pub long_idle_reset_secs: u64,
pub micro_enabled: bool,
pub long_enabled: bool,
pub micro_enforceable: bool,
pub long_enforceable: bool,
pub pause_during_dnd: bool,
pub pause_during_camera: bool,
pub pause_during_video: bool,
pub pause_media_during_breaks: bool,
pub work_window_enabled: bool,
pub work_start_minutes: u32,
pub work_end_minutes: u32,
pub work_days_mask: u8,
pub bedtime_enabled: bool,
pub bedtime_start_minutes: u32,
pub bedtime_end_minutes: u32,
pub bedtime_interval_secs: u64,
pub bedtime_duration_secs: u64,
pub prebreak_notification_enabled: bool,
pub prebreak_notification_seconds: u64,
pub overlay_opacity: f32,
pub overlay_color: String,
pub overlay_custom_rgb: String,
pub overlay_high_contrast: bool,
pub show_hint: bool,
pub monitor_placement: MonitorPlacement,
pub windowed_fraction: f64,
pub micro_windowed_fraction: Option<f64>,
pub long_windowed_fraction: Option<f64>,
pub strict_mode: bool,
pub postpone_enabled: bool,
pub micro_postpone_enabled: bool,
pub long_postpone_enabled: bool,
pub micro_skip_enabled: bool,
pub long_skip_enabled: bool,
pub postpone_minutes: u32,
pub show_current_time: bool,
pub clock_format: String,
pub micro_manual_finish: bool,
pub long_manual_finish: bool,
pub autostart_enabled: bool,
pub auto_check_updates: bool,
pub update_channel: UpdateChannel,
pub micro_sound: BreakSound,
pub long_sound: BreakSound,
pub sound_volume: f32,
pub app_pause_enabled: bool,
pub app_pause_list: Vec<String>,
pub break_health_enabled: bool,
pub morning_chore_prompt_enabled: bool,
pub micro_physical_hints: Vec<String>,
pub micro_psychological_hints: Vec<String>,
pub micro_hint_mix: HintMix,
pub long_hints: Vec<String>,
pub long_social_hints: Vec<String>,
pub long_hint_mix: HintMix,
pub sleep_hints: Vec<String>,
pub micro_routine: String,
pub long_routine: String,
pub micro_routine_categories: Vec<RoutineCategory>,
pub long_routine_categories: Vec<RoutineCategory>,
pub micro_routine_max_difficulty: RoutineDifficulty,
pub long_routine_max_difficulty: RoutineDifficulty,
pub custom_routines: Vec<Routine>,
pub routine_fill: bool,
pub allow_plugin_sounds: bool,
pub hint_rotate_seconds: u64,
pub delay_break_if_typing: bool,
pub typing_grace_secs: u64,
pub typing_max_deferral_secs: u64,
pub pause_countdown_if_typing: bool,
pub postpone_escalation_enabled: bool,
pub postpone_escalation_step_secs: u64,
pub postpone_max_count: u32,
pub overlay_font_scale: f32,
pub micro_fixed_times: Vec<String>,
pub long_fixed_times: Vec<String>,
pub micro_schedule_mode: ScheduleMode,
pub long_schedule_mode: ScheduleMode,
pub hooks_enabled: bool,
pub hooks: Vec<Hook>,
pub hotkeys_enabled: bool,
pub hotkeys: Vec<Hotkey>,
pub daily_screen_time_enabled: bool,
pub daily_screen_time_budget_minutes: u64,
pub daily_screen_time_remind_again_minutes: u64,
pub tray_countdown_enabled: bool,
pub tray_countdown_target: String,
pub micro_break_mode: BreakMode,
pub long_break_mode: BreakMode,
pub custom_css: String,
pub derived: DerivedCaches,
}Expand description
Single source of truth for one profile’s behaviour.
Deserialised from settings.json (one of these per profile in the
ProfilesFile array) and sent to the renderer wholesale through
get_settings. Field names line up 1:1 with the TypeScript
SchedulerSettings type — keep the two in sync; a serde roundtrip
parity test is on the backlog to enforce this in CI.
#[serde(default)] on the struct means each field falls back to
Default::default() if missing — older settings.json files keep
loading as new fields are added. Pre-split fields keep their old
JSON keys via #[serde(alias = "...")].
Fields§
§micro_interval_secs: u64§micro_duration_secs: u64§long_interval_secs: u64§long_duration_secs: u64§micro_idle_reset_secs: u64§long_idle_reset_secs: u64§micro_enabled: bool§long_enabled: bool§micro_enforceable: bool§long_enforceable: bool§pause_during_dnd: bool§pause_during_camera: bool§pause_during_video: bool§pause_media_during_breaks: boolWhen a break overlay opens, pause whatever media is playing and
resume it when the break ends. Distinct from the pause_during_*
guards above: those suppress breaks, this one lets the break
proceed while quieting your media. See crate::media.
work_window_enabled: bool§work_start_minutes: u32§work_end_minutes: u32§work_days_mask: u8Which weekdays the work window applies to, as a 7-bit mask: bit i
(0 = Monday … 6 = Sunday, matching chrono’s
Weekday::num_days_from_monday) set means breaks may fire on that
day. Only consulted when work_window_enabled is on. Defaults to
every day (0b111_1111) so an upgrading user — whose settings.json
predates this field — keeps the old “all days” behaviour. A wrapping
window (e.g. 22:00–06:00) gates its early-morning portion on the day
it started, not the calendar day it spills into; see
super::timers::work_window_active.
bedtime_enabled: bool§bedtime_start_minutes: u32§bedtime_end_minutes: u32§bedtime_interval_secs: u64§bedtime_duration_secs: u64§prebreak_notification_enabled: bool§prebreak_notification_seconds: u64§overlay_opacity: f32§overlay_color: String§overlay_custom_rgb: String§overlay_high_contrast: bool§show_hint: bool§monitor_placement: MonitorPlacement§windowed_fraction: f64Fraction of the monitor a windowed-mode break overlay fills,
clamped to [0.1, 1.0] by crate::scheduler::overlay::centered_windowed_rect. Defaults to
0.8 — the historical hardcoded value — so existing users see no
change. Per-kind overrides below take precedence when set; the
effective value is resolved by windowed_fraction_for.
micro_windowed_fraction: Option<f64>Optional per-kind windowed-size override for micro breaks. None
falls back to windowed_fraction.
long_windowed_fraction: Option<f64>Optional per-kind windowed-size override for long breaks. None
falls back to windowed_fraction. Sleep never renders windowed, so
it has no override.
strict_mode: bool§postpone_enabled: bool§micro_postpone_enabled: boolPer-kind postpone master switch, ANDed with the global
postpone_enabled so an upgrading user with postpone globally off
still has it off everywhere. Defaults true so existing on-disk
settings (which predate these keys) keep their prior behaviour:
the global flag alone decided postpone, and true && global == global.
long_postpone_enabled: bool§micro_skip_enabled: boolPer-kind skip (overlay dismiss) switch. Defaults true to match
the pre-split behaviour where any non-enforceable break could be
skipped.
long_skip_enabled: bool§postpone_minutes: u32§show_current_time: bool§clock_format: String§micro_manual_finish: bool§long_manual_finish: bool§autostart_enabled: bool§auto_check_updates: boolOpt-in: on launch, silently check the updater endpoint once and post a desktop notification if a newer build is available. Defaults on; the About tab exposes the toggle and the manual “Check for updates” button.
update_channel: UpdateChannelWhich release line the updater follows. Stable only ever sees
full releases; Beta also sees the weekly prerelease builds.
Switching back to Stable does not downgrade — semver ranks a
prerelease above the stable it precedes, so the build is kept
until a stable release overtakes it.
micro_sound: BreakSound§long_sound: BreakSound§sound_volume: f32§app_pause_enabled: bool§app_pause_list: Vec<String>§break_health_enabled: bool§morning_chore_prompt_enabled: boolWhen on, the first time the work window opens each day with an empty
chore list, Entracte opens Preferences to the chores input so the user
can plan the day’s chores. On by default; the Breaks tab can disable
it. See scheduler::chores::should_prompt_morning_chores.
micro_physical_hints: Vec<String>§micro_psychological_hints: Vec<String>§micro_hint_mix: HintMix§long_hints: Vec<String>§long_hint_mix: HintMix§sleep_hints: Vec<String>§micro_routine: StringGuided-routine mode for micro / long breaks: "" (off, fall back to
hint rotation), a routine id (always that routine), or "random" (the
engine picks one per break from the filtered pool). See
super::routines::resolve_routine.
long_routine: String§micro_routine_categories: Vec<RoutineCategory>Engine filters, applied only when the matching *_routine is
"random": the categories to draw from (empty = all) and the maximum
difficulty to include.
long_routine_categories: Vec<RoutineCategory>§micro_routine_max_difficulty: RoutineDifficulty§long_routine_max_difficulty: RoutineDifficulty§custom_routines: Vec<Routine>User routines imported from content packs (#155), added to the bundled
starters by super::routines::all_routines. Empty by default.
routine_fill: boolDefault pacing for routines that do not declare their own
super::types::RoutinePacing. When true, step durations are
treated as relative weights and scaled to fill the break length
(fill mode). When false (default), steps run at their authored
duration and the last step holds until the break ends (hold mode).
A routine’s own pacing field always takes precedence.
allow_plugin_sounds: boolWhether a routine’s plugin-supplied sound cues may play (default
true). The user’s master kill switch for plugin audio; cues always
route through sound_volume regardless.
hint_rotate_seconds: u64§delay_break_if_typing: bool§typing_grace_secs: u64§typing_max_deferral_secs: u64§pause_countdown_if_typing: bool§postpone_escalation_enabled: bool§postpone_escalation_step_secs: u64§postpone_max_count: u32§overlay_font_scale: f32§micro_fixed_times: Vec<String>§long_fixed_times: Vec<String>§micro_schedule_mode: ScheduleMode§long_schedule_mode: ScheduleMode§hooks_enabled: bool§hooks: Vec<Hook>§hotkeys_enabled: boolMaster switch for the native global hotkeys; when off, nothing is
registered with the OS regardless of hotkeys.
hotkeys: Vec<Hotkey>User-configured global-hotkey bindings (action + accelerator). See
super::hotkeys; resolved by registrable_bindings.
daily_screen_time_enabled: bool§daily_screen_time_budget_minutes: u64§daily_screen_time_remind_again_minutes: u64§tray_countdown_enabled: bool§tray_countdown_target: String§micro_break_mode: BreakMode§long_break_mode: BreakMode§custom_css: StringSupporter-only freeform stylesheet, applied to both the settings
window and the break overlay via the renderer’s
useCustomStylesheet hook (which uses adoptedStyleSheets so we
don’t need to weaken the strict style-src 'self' CSP). The
supporter gate lives in commands::settings::gate_custom_css,
and sanitize_custom_css strips @import / expression( on
every read+write.
derived: DerivedCachesStable per-load derivations (parsed fixed times, etc.) resolved
once via Settings::rebuild_derived rather than on every tick /
fire. Never serialised: #[serde(skip)] keeps it off disk and out
of the Rust↔TS parity surface, and it’s rebuilt explicitly at each
settings-replacement site. Defaults empty; callers that bypass
rebuild_derived (e.g. raw struct literals in tests) just see
empty caches, which the run loop treats as “no fixed times”.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn for_kind(&self, kind: BreakKind) -> Option<BreakKindSettings<'_>>
pub fn for_kind(&self, kind: BreakKind) -> Option<BreakKindSettings<'_>>
Borrowed per-kind view collapsing the micro_* / long_* field
pairs (see BreakKindSettings). Returns None for
BreakKind::Sleep, which has no interval/duration/mode pair —
callers handle the sleep case with its dedicated fields.
Sourcefn schedule_mode_for(&self, kind: BreakKind) -> Option<ScheduleMode>
fn schedule_mode_for(&self, kind: BreakKind) -> Option<ScheduleMode>
The ScheduleMode for the given break kind. Sleep has no
interval/fixed split, so its mode never participates in either
active-check — both report false (see interval_active /
fixed_active).
Sourcepub fn interval_active(&self, kind: BreakKind) -> bool
pub fn interval_active(&self, kind: BreakKind) -> bool
True iff this break kind’s schedule fires on a repeating interval. Centralises the dispatch the run loop would otherwise duplicate at every call site.
Sourcepub fn fixed_active(&self, kind: BreakKind) -> bool
pub fn fixed_active(&self, kind: BreakKind) -> bool
True iff this break kind’s schedule fires at fixed clock times.
Sourcepub fn postpone_available_for(&self, kind: BreakKind) -> bool
pub fn postpone_available_for(&self, kind: BreakKind) -> bool
Fully-resolved postpone availability for this kind: the per-kind
switch ANDed with the global postpone_enabled master and gated by
strict_mode. Sleep has no per-kind pair, so it falls back to the
global master alone — preserving the pre-split behaviour where the
bedtime postpone path was governed by postpone_enabled only.
Sourcepub fn skip_available_for(&self, kind: BreakKind) -> bool
pub fn skip_available_for(&self, kind: BreakKind) -> bool
Fully-resolved overlay-skip availability for this kind: the
per-kind switch gated by strict_mode. Sleep has no per-kind pair
and is never skippable via the overlay (the sleep fire site sets
skip_available: false directly), so it falls back to false
here. The enforceable gate is applied separately at the overlay
fire site (an enforceable break can’t be dismissed regardless).
Sourcepub fn rebuild_derived(&mut self)
pub fn rebuild_derived(&mut self)
Re-derive the derived cache from the current source fields.
Must be called at every point where a Settings value is stored
into the scheduler’s mutex (settings update, profile switch /
reset, IPC set, backup import, construction) so the cache can
never lag the settings it summarises. clamp calls it last, so
any path that clamps (load + the renderer update path) is covered
automatically; the no-clamp replacement sites call it explicitly.
Sourcepub fn clamp(&mut self)
pub fn clamp(&mut self)
Clamp every numeric field to a safe range. Called on every load
(post-deserialise) and on every write (post-merge) so that a
hand-edited or corrupted settings.json can’t make the
scheduler misbehave — e.g. micro_interval_secs: 0 would fire
a break every tick of the 1Hz loop. Values inside the range are
left untouched.
The bounds are deliberately generous (the UI’s min / max
attributes are tighter); we only catch the values that produce
pathological behaviour.
Source§impl Settings
impl Settings
Sourcepub fn effective_hints(&self, kind: BreakKind) -> Vec<String>
pub fn effective_hints(&self, kind: BreakKind) -> Vec<String>
The resolved hint pool to show for kind: the per-kind cache for
micro/long (honouring its hint mix), or the sleep pool for Sleep.
Collapses the match kind { Micro => effective_micro_hints(s), … }
ladder the fire paths used to repeat.
Sourcepub fn duration_and_manual_finish(&self, kind: BreakKind) -> (u64, bool)
pub fn duration_and_manual_finish(&self, kind: BreakKind) -> (u64, bool)
The duration_secs and manual_finish a break of kind fires with:
the per-kind pair for micro/long, or the bedtime duration / no
manual-finish for Sleep. The enforceability and hint pool are
resolved separately (see test_break_enforceable / effective_hints)
so the renderer and CLI paths share one enforceability rule.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more