feat(ui): add dedicated calm block screen mode and auto-launch from daemon
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user