Skip to content

[Linux] bug in battery_charge() #40

Description

@laur89

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions