Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.78k stars 710 forks source link

Battery status not updated in module. #3726

Open onbo-moth opened 1 month ago

onbo-moth commented 1 month ago

I'm using Waybar v0.11.0 on a Lenovo Ideapad laptop with TLP configured to limit the battery charge up to a certain percentage. When the battery reaches this threshold, /sys/class/power_supply/BAT0/status reports "Not charging", which Waybar interprets as "not-charging". However, the "not-charging" class and format does not apply to the battery module when the battery is in this state.

When i have this set in my style.css

#battery.not-charging {
  color: red;
}

It should turn the text red, but it doesn't. It neither turns the label into given text.

"battery": {
  // ...
  "format-not-charging": "Not charging"
  // ...
}

Also, it would be useful to note in the battery module documentation that Waybar not only converts status names to lowercase, but also replaces spaces with hyphens.