git.lucas.co / cce-notifier
notification daemon
git clone https://git.lucas.co/cce-notifier.git

commite99bd6a7aba8bd3a321fe64171b9954c77d2da4f
parent1f4354ed54
authorLucas Galante <[email protected]>
date2026-07-07 09:40
refactor: route hardcoded config/font paths through cce_ui XDG helpers

Replace hardcoded /home/lsgalante paths with cce_ui::config::get_config_path/
cce_config_dir/config_home (and cce_ui::fonts_dir where applicable). Defensive
$HOME-fallback branches left as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

 src/main.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 561e48d..0e4de9d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -460,8 +460,8 @@ static CONFIG_CACHE: std::sync::RwLock<CachedConfig> = std::sync::RwLock::new(Ca
 });
 
 fn load_config() -> serde_json::Value {
-    let path = "/home/lsgalante/.config/cce/config.kdl";
-    let current_modified = std::fs::metadata(path).ok().and_then(|m| m.modified().ok());
+    let path = cce_ui::config::get_config_path();
+    let current_modified = std::fs::metadata(&path).ok().and_then(|m| m.modified().ok());
     
     if let Ok(cache) = CONFIG_CACHE.read() {
         if cache.last_modified.is_some() && cache.last_modified == current_modified {
@@ -471,7 +471,7 @@ fn load_config() -> serde_json::Value {
         }
     }
     
-    let content = std::fs::read_to_string(path).unwrap_or_default();
+    let content = std::fs::read_to_string(&path).unwrap_or_default();
     let val = cce_ui::config::parse_kdl_to_json(&content);
     if let Ok(mut cache) = CONFIG_CACHE.write() {
         cache.last_modified = current_modified;