feat(ui): add dedicated calm block screen mode and auto-launch from daemon

This commit is contained in:
2026-10-02 18:06:43 +03:00
parent 9e44bd4b32
commit 4ef9674fde
2 changed files with 10 additions and 1 deletions
+8
View File
@@ -167,6 +167,14 @@ fn enforce_if_blocked(
&format!("Blocker: {target_name} blocked"),
"Focus blocked by active schedule",
);
// Launch the calm block screen GUI in the background if available
let ui_exe = std::env::current_exe()
.ok()
.and_then(|p| p.parent().map(|d| d.join("blocker-ui")))
.unwrap_or_else(|| std::path::PathBuf::from("blocker-ui"));
let _ = std::process::Command::new(ui_exe).arg("--block").spawn();
1
}
Err(e) => {
+2 -1
View File
@@ -13,7 +13,8 @@ fn main() -> eframe::Result<()> {
viewport: egui::ViewportBuilder::default()
.with_inner_size(if is_block_screen { [520.0, 360.0] } else { [720.0, 520.0] })
.with_min_inner_size([400.0, 300.0])
.with_title("Blocker"),
.with_title(if is_block_screen { "Blocker — Stay Focused" } else { "Blocker" })
.with_always_on_top(),
..Default::default()
};