Repository navigation
Battery panel shows wrong percentage on dual-battery laptops (uses only first battery, ignores second) #8678
wasyleque
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description:
On a laptop with two batteries (BAT0 + BAT1), the bar's battery indicator correctly shows the combined percentage from UPower's DisplayDevice (weighted by capacity across both batteries). But clicking the indicator to open the battery panel shows a different, wrong value — the panel is fed by omarchy-battery-status, which does upower -e | grep BAT | head -n 1 and only ever reads the first battery device, ignoring any others.
Steps to reproduce:
Expected: Panel percentage (and other stats: rate, time remaining, cycles) should match the bar's combined value, or ideally show a breakdown per battery.
System:
Relevant data:
$ upower -e | grep BAT
/org/freedesktop/UPower/devices/battery_BAT0
/org/freedesktop/UPower/devices/battery_BAT1
BAT0: state=fully-charged, percentage=100%, energy-full=21.5Wh
BAT1: state=discharging, percentage=79%, energy-full=22.52Wh
DisplayDevice: percentage=89.48% (bar shows this, rounded to 90%)
Root cause: omarchy-battery-status (in /usr/share/omarchy/bin/) only queries the first battery from upower -e | grep BAT | head -n 1, with no aggregation across multiple batteries, unlike the bar widget which uses UPower's DisplayDevice.
All reactions