Battery icon indicating copy to clipboard operation
Battery copied to clipboard

[Linux] bug in battery_charge()

Open laur89 opened this issue 6 years ago • 1 comments

The arch-ubuntu-suse flow looks buggy:

            battery_state=$(cat $battery_path/energy_now)
            battery_current=$battery_path/energy_now
...
            if [ $battery_state == 'Discharging' ]; then
...
            now=$(cat $battery_current)
            full=$(cat $battery_full)
            BATT_PCT=$((100 * $now / $full))

Note $now is same as $battery_state, yet the former is used in calculation while latter in string comparison.

Don't have a setup to verify this though.

laur89 avatar Oct 28 '17 16:10 laur89

I don't have a linux setup to verify this, could you open a PR with a fix and verify it? Otherwise I'll just close it down. 😢

Goles avatar Dec 18 '17 18:12 Goles