status bar
git clone https://git.lucas.co/cce-status-interface.git
feat: module { background_color } app-config key
Seventh key in the bar's config file: module { background_color } — the
module box fill — read ahead of the shared status_background_color
through cfg_quad_color (so the sRGB→linear conversion and the
background_blur tint scaling apply unchanged). Verified live: a
translucent red repainted every box within seconds off the mtime poll
(bevel shading composing over it correctly) and restored cleanly.
Co-Authored-By: Claude Fable 5 <[email protected]>
CLAUDE.md | 4 +++-
src/config.rs | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index 2962a36..12de8d0 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -119,7 +119,9 @@ 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) and
`module { font }` (module text family; an embedded size ranks below
-module { font_size } in the size chain). Everything is read through
+module { font_size } in the size chain) and `module { background_color }` (the
+module box fill, rgba; linearized like every quad color, and the
+background_blur tint scaling still applies on top). 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 b012ae4..4a6a406 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -235,7 +235,11 @@ pub(crate) fn read_status_background_blur_from_config() -> f32 {
}
pub(crate) fn read_status_box_background_color_from_config() -> Option<[f32; 4]> {
- let mut color = cfg_quad_color("/style/status/background_color", "status_background_color")
+ // App-native `module { background_color }` first (a quad color — the
+ // sRGB→linear conversion applies, per the color-space split in
+ // CLAUDE.md), then the shared status key, then the built-in default.
+ let mut color = cfg_quad_color("/module/background_color", "module_background_color")
+ .or_else(|| cfg_quad_color("/style/status/background_color", "status_background_color"))
.unwrap_or_else(|| {
let c = cce_ui::color::srgb_to_linear(0x15 as f32 / 255.0);
let b = cce_ui::color::srgb_to_linear(0x20 as f32 / 255.0);