Skip to main content

Settings

Struct Settings 

Source
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: bool

When 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: u8

Which 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: f64

Fraction 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: bool

Per-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: bool

Per-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: bool

Opt-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: UpdateChannel

Which 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: bool

When 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_social_hints: Vec<String>§long_hint_mix: HintMix§sleep_hints: Vec<String>§micro_routine: String

Guided-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: bool

Default 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: bool

Whether 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: bool

Master 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: String

Supporter-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: DerivedCaches

Stable 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

Source

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.

Source

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).

Source

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.

Source

pub fn fixed_active(&self, kind: BreakKind) -> bool

True iff this break kind’s schedule fires at fixed clock times.

Source

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.

Source

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).

Source

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.

Source

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

Source

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.

Source

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 Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: Sized + AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> IpcResponse for T
where T: Serialize,

§

fn body(self) -> Result<InvokeResponseBody, Error>

Resolve the IPC response body.
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

§

type Error = Error

The error type.
§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more