status bar
git clone https://git.lucas.co/cce-status-interface.git
feat: module { font } app-config key
Sixth key in the bar's config file: module { font } — the module text
family — read ahead of the shared status font and the fontconfig
status-interface alias. An embedded size in the value ranks below
module { font_size } but above the shared font string in the size
chain, keeping most-specific-first resolution.
Verified live: font "serif" restyled every module within seconds off
the mtime poll (boxes re-measured to the new metrics cleanly), then
restored to "Chivo Mono".
Co-Authored-By: Claude Fable 5 <[email protected]>
CLAUDE.md | 4 +++-
src/config.rs | 11 +++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index 2884868..2962a36 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -117,7 +117,9 @@ compositor's segment height + reserved strip on `ccectl reload` — falls back t
the shared `layout { bar_height }`) and `module { padding }` (text inset inside
each module box, bar-side only, falls back to the shared `status_padding`) and
`module { font_size }` (module text size, bar-side only; beats even the size
-embedded in the shared font string, which remains the fallback). Everything is read through
+embedded in the shared font string, which remains the fallback) and
+`module { font }` (module text family; an embedded size ranks below
+module { font_size } in the size chain). Everything is read through
`cce_ui::config::cached_config()`; KDL is converted to JSON
(`cce_ui::config::parse_kdl_to_json`) and looked up with the local `json_find_key`,
which splits snake_case keys across nesting — `status_background_color` matches
diff --git a/src/config.rs b/src/config.rs
index 6a5aa4b..b012ae4 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -121,6 +121,11 @@ pub(crate) fn read_disabled_color_from_config() -> Option<[f32; 4]> {
}
pub(crate) fn read_status_font_from_config() -> String {
+ // App-native `module { font }` first (a family; an embedded size ranks
+ // below module { font_size } in the size chain), then the shared key.
+ if let Some(font_str) = cfg_string("/module/font", "module_font") {
+ return font_str;
+ }
if let Some(font_str) = cfg_string("/style/status/font", "status_font") {
return font_str;
}
@@ -150,6 +155,12 @@ pub(crate) fn read_status_font_size_from_config() -> f32 {
if let Some(size) = cfg_f32("/module/font_size", "module_font_size") {
return size;
}
+ if let Some(font_str) = cfg_string("/module/font", "module_font") {
+ let (_, parsed_size) = cce_ui::layout::parse_font_string(&font_str);
+ if let Some(size) = parsed_size {
+ return size;
+ }
+ }
if let Some(font_str) = cfg_string("/style/status/font", "status_font") {
let (_, parsed_size) = cce_ui::layout::parse_font_string(&font_str);
if let Some(size) = parsed_size {