built-in battery module is not realtime
The built-in battery module can take 20s or so take update it's state to react to a charger being plugged in or out. This dissonance between what the computer is telling me and what is actually the case is confusing and annoying.
have you tried changing the interval to say 1?
"interval": 1,
this will refresh it every secs. put to 5 or 10 depending on your wish
sample: "battery": { "bat": "BAT2", "interval": 1, "states": { "warning": 30, "critical": 15 }, "format": "{capacity}% {icon}", "format-icons": ["", "", "", "", ""], "max-length": 25 }
This is not a good solution as it uses more cpu time and is still not instant. The battery module should get notified of changed state immediately and not have to check for current state periodically.
You can use "upower" module, for me its almost instantaneous.
thanks, it's very fast in updating and shows the correct combined battery percentage too, unlike the battery module.
Now i have to hope that upower has a better code in place. At least it says in its readme that it listens to device events, which i am guessing includes the batteries.
Actually no, I am opening this again because I think that either upower should be the default battery module or that the default battery module should not periodically check for status but instead use some sort of listener/hook to get informed that state changed. Using filesystem listeners on /sys/class/power_supply/BAT*/ comes to mind but there is probably a better way.
hmm, since the main issue with this is, that it doesn't update instantly when unplugging/plugging power, not that it doesn't update in realtime when charging/discharging, it seems fine to me to close this after #3474