1
0
Fork 0
mirror of synced 2024-12-22 06:41:07 -05:00

worked around broken /sys/class/power_supply/<supply_name>/capacity > 100, resolves #460

This commit is contained in:
Gregory Pakosz 2021-03-05 19:02:15 +01:00
parent a752c41bca
commit 4868ac4bd9

View file

@ -303,7 +303,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false") # discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
# bat_capacity="$batpath/capacity" # bat_capacity="$batpath/capacity"
# if [ -r "$bat_capacity" ]; then # if [ -r "$bat_capacity" ]; then
# charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + capacity / 100 }') # charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + (capacity > 100 ? 100 : capacity) / 100 }')
# else # else
# bat_energy_full="$batpath/energy_full" # bat_energy_full="$batpath/energy_full"
# bat_energy_now="$batpath/energy_now" # bat_energy_now="$batpath/energy_now"