fixed _battery_info() when pmset doesn't report a charge percentage, fixes #512

This commit is contained in:
Gregory Pakosz 2021-08-31 09:37:48 +02:00
parent a63dc5c6a9
commit 4f332e6b17
1 changed files with 1 additions and 1 deletions

View File

@ -288,7 +288,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# while IFS= read -r line; do # while IFS= read -r line; do
# [ -z "$line" ] && continue # [ -z "$line" ] && continue
# discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false") # discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
# percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%') # percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%' || echo "0%")
# charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }') # charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }')
# count=$((count + 1)) # count=$((count + 1))
# done << EOF # done << EOF