From 4f332e6b1748c1bc54db9e456c64f8509b465da8 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Tue, 31 Aug 2021 09:37:48 +0200 Subject: [PATCH] fixed _battery_info() when pmset doesn't report a charge percentage, fixes #512 --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 18df782..060f134 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -288,7 +288,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # while IFS= read -r line; do # [ -z "$line" ] && continue # 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 }') # count=$((count + 1)) # done << EOF