status bar
git clone https://git.lucas.co/cce-status-interface.git
feat(battery): the charging state swaps in the battery-charging glyph
The icon form of the text readout's ⚡ prefix; the accent color stays.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
CLAUDE.md | 7 ++++---
src/modules.rs | 6 +++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index 5a54a0e..f8325a1 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -99,9 +99,10 @@ the digits and drawn between the glyph and the number (`IconPrim::pocket`,
`module { icon_pocket }`). Same-hue was the problem — white digits on a white
ghost had only the alpha gap for contrast — and the pocket is the bubble
scrim's answer applied locally: darken the ground under the digits rather
-than outline the letterforms. The muted sink swaps to `volume-muted`; the
-battery keeps its accent color while charging or under 10% (the only
-charging cue now that the "⚡" prefix went with the text form). A module whose
+than outline the letterforms. The muted sink swaps to `volume-muted`, the
+charging battery to `battery-charging` (the bolt runs the glyph's full
+height so its tips clear the digit pocket); the battery also keeps its
+accent color while charging or under 10%. A module whose
reader has nothing (no battery, no backlight, no pactl) returns `None` and
has width 0, i.e. it is hidden rather than an empty bubble; a reader that
answers without a number (cpu with no /proc/stat, a sink with no level)
diff --git a/src/modules.rs b/src/modules.rs
index e784433..e912504 100644
--- a/src/modules.rs
+++ b/src/modules.rs
@@ -522,11 +522,11 @@ impl IconStat for BatteryModule {
Some(s) => s.battery?,
None => (100, false),
};
- // Accent while charging or nearly flat — the one cue left for
- // charging now that the "⚡" prefix has gone with the text form.
+ // Accent while charging or nearly flat; charging also swaps in the
+ // bolt glyph, the icon form of the text readout's "⚡" prefix.
let color = if !charging && cap > 10 { normal_color } else { color::TEXT_ACCENT };
Some(IconReadout {
- icon: "battery",
+ icon: if charging { "battery-charging" } else { "battery" },
number: Some(cap.to_string()),
color,
fallback: format!("{} {cap}%", if charging { "⚡" } else { "Bat" }),