From 4868ac4bd9910de3c8a89ab5b1d150e24caf2c6f Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Fri, 5 Mar 2021 19:02:15 +0100 Subject: [PATCH] worked around broken /sys/class/power_supply//capacity > 100, resolves #460 --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index ee6968c..503d9c6 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -303,7 +303,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false") # bat_capacity="$batpath/capacity" # 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 # bat_energy_full="$batpath/energy_full" # bat_energy_now="$batpath/energy_now"