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

commit75f9a09c7846bec89bbb36d7239e87d68efebbab
parent3417c2e696
authorLucas Galante <[email protected]>
date2026-08-22 23:56
fix: drop the fontconfig rung from the status font chain

read_status_font_from_config resolved `module { font }`, then
`/style/status/font`, then fontconfig's `status-interface` alias. That third
rung was a cce invention squatting in fontconfig's family namespace, and the
chain had already demoted it to a last resort — with either KDL key set it
was never reached. It is gone along with the settings app's Fonts page, which
was the only thing that ever wrote it; the DE's families now live in the
shared config's `fonts { }` block, so the tail of the chain is the shared sans
family. The local fontconfig XML parser goes with it.

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

 src/config.rs | 38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/src/config.rs b/src/config.rs
index 20d20cc..da487b3 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -67,13 +67,12 @@ pub(crate) fn read_status_font_from_config() -> String {
         return font_str;
     }
 
-    let font_conf_path = cce_ui::config::config_home().join("fontconfig").join("fonts.conf");
-    if let Ok(content) = std::fs::read_to_string(&font_conf_path) {
-        if let Some(font) = parse_font_for_alias(&content, "status-interface") {
-            return font;
-        }
-    }
-    "sans-serif".to_string()
+    // The third rung used to be fontconfig's `status-interface` alias — a cce
+    // invention squatting in fontconfig's family namespace, and one this
+    // precedence chain had already demoted to a last resort. It is gone along
+    // with the settings app's Fonts page; the DE's families now live in the
+    // shared config's `fonts { }` block.
+    cce_ui::layout::read_preferred_fonts().0
 }
 
 pub(crate) fn read_status_height_from_config() -> f32 {
@@ -126,31 +125,6 @@ pub(crate) fn read_status_module_spacing_from_config() -> f32 {
 }
 
 
-pub(crate) fn parse_font_for_alias(content: &str, alias: &str) -> Option<String> {
-    let lines: Vec<&str> = content.lines().collect();
-    for i in 0..lines.len() {
-        let line = lines[i].trim();
-        if line.contains("<test") && line.contains("name=\"family\"") && line.contains(&format!("<string>{}</string>", alias)) {
-            for j in (i + 1)..(i + 6).min(lines.len()) {
-                let next_line = lines[j].trim();
-                if next_line.contains("<edit") {
-                    for k in (j + 1)..(j + 6).min(lines.len()) {
-                        let str_line = lines[k].trim();
-                        if str_line.contains("<string>") && str_line.contains("</string>") {
-                            if let Some(start) = str_line.find("<string>") {
-                                if let Some(end) = str_line.find("</string>") {
-                                    return Some(str_line[start + 8..end].to_string());
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    None
-}
-
 /// The DE-wide light angle, canonical at `window_manager { light_source_position }`.
 /// Radians normally; a value above 2π is taken as legacy degrees (e.g. `135`)
 /// and converted. (This unifies the two previous readers, one of which only