pub struct Settings {Show 73 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 work_window_enabled: bool,
pub work_start_minutes: u32,
pub work_end_minutes: u32,
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 strict_mode: bool,
pub postpone_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 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 micro_physical_hints: Vec<String>,
pub micro_psychological_hints: Vec<String>,
pub micro_hint_mix: String,
pub long_hints: Vec<String>,
pub long_social_hints: Vec<String>,
pub long_hint_mix: String,
pub sleep_hints: Vec<String>,
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: String,
pub long_schedule_mode: String,
pub hooks_enabled: bool,
pub hooks: Vec<Hook>,
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: String,
pub long_break_mode: String,
pub custom_css: String,
}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§work_window_enabled: bool§work_start_minutes: u32§work_end_minutes: u32§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§strict_mode: bool§postpone_enabled: bool§postpone_minutes: u32§show_current_time: bool§clock_format: String§micro_manual_finish: bool§long_manual_finish: bool§autostart_enabled: bool§micro_sound: BreakSound§long_sound: BreakSound§sound_volume: f32§app_pause_enabled: bool§app_pause_list: Vec<String>§break_health_enabled: bool§micro_physical_hints: Vec<String>§micro_psychological_hints: Vec<String>§micro_hint_mix: String§long_hints: Vec<String>§long_hint_mix: String§sleep_hints: Vec<String>§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: String§long_schedule_mode: String§hooks_enabled: bool§hooks: Vec<Hook>§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: String§long_break_mode: String§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.
Implementations§
Source§impl Settings
impl Settings
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.