From e631331281e5ce37d921bbc241987dab81de6d94 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 29 Apr 2019 23:18:27 +0200 Subject: [PATCH] fixed buggy battery detection logic, likely fixes #233 --- .tmux.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index cb9db94..9bc28e7 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -237,6 +237,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # } # # _battery() { +# count=0 # charge=0 # uname_s=$(uname -s) # case "$uname_s" in @@ -301,7 +302,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # done # ;; # esac -# charge=$(awk -v charge="$charge" -v count="$count" 'BEGIN { print charge / count }') +# [ "$count" -ne 0 ] && charge=$(awk -v charge="$charge" -v count="$count" 'BEGIN { print charge / count }') # if [ "$charge" -eq 0 ]; then # tmux set -ug '@battery_status' \;\ # set -ug '@battery_bar' \;\