• Bruce Weirdan's avatar
    Report only active battery (#4726) · b8b87629
    Bruce Weirdan authored
    On a system with multiple batteries (like thinkpads) report percentage
    and time remaining only for the active battery (the one being
    discharged).
    
    Ideally we should report all batteries, but acpi only shows time remaining
    for the active battery. Also callers of these functions expect a single
    return value. This is still better than reporting 596% remaining (like it
    did on my laptop).
    
    For the reference, the output of acpi command with multiple batteries looks
    like this:
    
        Battery 0: Unknown, 5%
        Battery 1: Discharging, 86%, 03:14:04 remaining
    b8b87629
Name
Last commit
Last update
.github Loading commit data...
cache Loading commit data...
custom Loading commit data...
lib Loading commit data...
log Loading commit data...
plugins Loading commit data...
templates Loading commit data...
themes Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE.txt Loading commit data...
README.md Loading commit data...
oh-my-zsh.sh Loading commit data...