gardesk/tarmac / f96f4aa

Browse files

spawn ers from border settings, restart on config reload

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
f96f4aa60636b63cecb036d22beaeb298c234be4
Parents
cb35875
Tree
57d98f0

1 changed file

StatusFile+-
M tarmac/src/main.rs 10 2
tarmac/src/main.rsmodified
@@ -64,6 +64,7 @@ fn main() {
6464
     state.borders.unfocused_color =
6565
         tarmac::platform::border::BorderColor::from_hex(&config.settings.border_color_unfocused);
6666
     state.borders.radius = config.settings.border_radius;
67
+    state.borders.spawn();
6768
     state.discover_and_observe();
6869
     WM_STATE.with(|s| *s.borrow_mut() = Some(state));
6970
 
@@ -280,7 +281,7 @@ fn generate_default_config_if_missing(path: &std::path::Path) {
280281
     if let Some(parent) = path.parent() {
281282
         let _ = std::fs::create_dir_all(parent);
282283
     }
283
-    let default_config = r#"-- tarmac configuration
284
+    let default_config = r##"-- tarmac configuration
284285
 -- ~/.config/tarmac/init.lua
285286
 
286287
 -- Modifier key: "command", "option", or "control"
@@ -359,9 +360,15 @@ gar.bind("mod+shift+r", "reload")
359360
 -- gar.rule({ app_name = "System Settings" }, { floating = true })
360361
 -- gar.rule({ app_name = "Safari" }, { workspace = 2 })
361362
 
363
+-- Borders (set border_width > 0 to enable ers)
364
+gar.set("border_width", "4")
365
+gar.set("border_color_focused", "#5294e2")
366
+gar.set("border_color_unfocused", "#59595980")
367
+gar.set("border_radius", "10")
368
+
362369
 -- Autostart (uncomment as needed)
363370
 -- gar.exec_once("sketchybar")
364
-"#;
371
+"##;
365372
 
366373
     match std::fs::write(path, default_config) {
367374
         Ok(()) => tracing::info!(?path, "generated default config"),
@@ -774,6 +781,7 @@ fn reload_config() {
774781
                 &config.settings.border_color_unfocused,
775782
             );
776783
             state.borders.radius = config.settings.border_radius;
784
+            state.borders.restart();
777785
             // Reapply layout with potentially new gap/bar values
778786
             state.apply_layout();
779787
             state.update_borders();