git.lucas.co / cce-status-interface
status bar
git clone https://git.lucas.co/cce-status-interface.git

commit22c87a4444ba294e570a09688fab339d16b35c7b
parent726264ffbb
authorLucas Galante <[email protected]>
date2026-08-05 08:18
feat: per-app config file, starting with module { corner_radius }

~/.config/cce/cce-status-interface/config.kdl is now the bar's own
config (cce-ui already merges it over the shared config by executable
name). First key: module { corner_radius } — the overall module box
radius, app-native spelling — falling back to the shared config's
status_box_corner_radius, then 4.0. The tick() reload poll now watches
the newest mtime of BOTH files via cce_ui::config::config_files_modified,
so app-file edits apply live like shared-config edits always have.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/config.rs |  8 +++++++-
 src/main.rs   | 17 ++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/config.rs b/src/config.rs
index 3f319c4..08ad5a0 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -222,7 +222,13 @@ pub(crate) fn read_status_box_background_color_from_config() -> Option<[f32; 4]>
 }
 
 pub(crate) fn read_status_box_corner_radius_from_config() -> f32 {
-    cfg_f32("/style/status/box_corner_radius", "status_box_corner_radius").unwrap_or(4.0)
+    // The app's own config wins (~/.config/cce/cce-status-interface/config.kdl,
+    // merged over the shared config by cce-ui): `module { corner_radius }` is
+    // the app-native spelling for the overall module box radius. The shared
+    // config's status key remains the DE-wide fallback.
+    cfg_f32("/module/corner_radius", "module_corner_radius")
+        .or_else(|| cfg_f32("/style/status/box_corner_radius", "status_box_corner_radius"))
+        .unwrap_or(4.0)
 }
 
 /// Bevel treatment for the module boxes.
diff --git a/src/main.rs b/src/main.rs
index 490e896..a0e437e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1004,7 +1004,7 @@ impl cce_ui::engine::Application for StatusApp {
             left_modules,
             right_modules,
             sender,
-            last_config_modified: std::fs::metadata(cce_ui::config::get_config_path()).ok().and_then(|m| m.modified().ok()),
+            last_config_modified: cce_ui::config::config_files_modified(),
             selected_module_name: selected_module.as_ref().map(|(n, _)| n.clone()),
             selected_module_side: selected_module.as_ref().map(|(_, s)| s.clone()),
             status_hide_mode: false,
@@ -1134,14 +1134,13 @@ impl cce_ui::engine::Application for StatusApp {
     }
 
     fn tick(&mut self, _dt: f32, needs_rebuild: &mut bool) {
-        if let Ok(metadata) = std::fs::metadata(cce_ui::config::get_config_path()) {
-            if let Ok(modified) = metadata.modified() {
-                if Some(modified) != self.last_config_modified {
-                    self.last_config_modified = Some(modified);
-                    *needs_rebuild = true;
-                    self.needs_rebuild = true;
-                }
-            }
+        // Watches the shared config AND the app's own override file (the
+        // newest mtime of the pair) — same key cce-ui's config cache uses.
+        let modified = cce_ui::config::config_files_modified();
+        if modified.is_some() && modified != self.last_config_modified {
+            self.last_config_modified = modified;
+            *needs_rebuild = true;
+            self.needs_rebuild = true;
         }
     }