yambar-modules-battery(5)
π battery β the module that reads ur battery status π
okay so this is yambar-modules-battery(5), bestie β a whole manpage in the File Formats Manual section, and it's literally the one that tells u what ur battery is doing. let's get into it π«Ά
β¨ NAME β¨
battery β this module reads battery status. that's it. that's the vibe check. π
πΈ DESCRIPTION πΈ
so this module reads battery status from /sys/class/power_supply and uses udev to monitor for changes. icon behaviour, no cap. β¨
now, real talk: it is common (and like, "normal") for batteries to be in the state unknown under certain conditions. don't panic, it's not u, it's them. π
for example, some have been seen to enter the unknown state when charging and the capacity reaches ~90%. the battery then stays in unknown, rather than charging, until it has been fully charged and enters the state full. like it just refuses to participate?? π
this does not happen with all batteries, and other batteries may enter the state unknown under other conditions. so basically, batteries are unhinged and we love them anyway. π
π¦ TAGS π¦
here's everything the module exposes as tags, bestie β every single one, i would never gatekeep:
nameβ string β the battery device name πmanufacturerβ string β name of the battery manufacturer πmodelβ string β the battery model name π·οΈstateβ string β one offull,not charging,charging,dischargingorunknownπcapacityβ range β capacity left, in percent πestimateβ string β estimated time left (to empty while discharging, or to full while charging), formatted asHH:MM. β°
π CONFIGURATION π
these are the knobs u can turn. "Req" = is it required? yes or no, no mystery:
nameβ string β required: yes β battery device name (one of the names in/sys/class/power_supply) πpoll-intervalβ int β required: no β how often, in milliseconds, to poll for capacity changes (default=60000). Set it to0to disable polling.
β οΈ warning bestie: many batteries do not support asynchronous reporting. so like, turning polling off might leave u in the dark fr fr.
Also it cannot be less than 250ms β that's the floor, periodt. π«
battery-scaleβ int β required: no β how much to scale down the battery charge amount. some batteries report too high, resulting in bad discharge estimates. Default=1. πsmoothing-secsβ int β required: no β how many seconds to perform smoothing over for battery discharge estimates. Default=100s. π§
π EXAMPLES π
here's one that ate, honestly:
bar:
left:
- battery:
name: BAT0
poll-interval: 30000
content:
string: {text: "BAT: {capacity}% {estimate}"}
look at that. BAT0, polling every 30000 ms, and a string particle showing BAT: {capacity}% {estimate}. iconic. β¨
π SEE ALSO π
go read these next, i'm obsessed with cross-references:
π«Ά this has been the yambar-modules-battery(5) page from the File Formats Manual, dated 2024-04-22. go forth and monitor ur battery, bestie β slay π
π
π¦ where this page comes from
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms