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

launch _battery_bar() background job only if a battery is present

This commit is contained in:
Gregory Pakosz 2020-02-17 20:20:19 +01:00
parent f7e383460d
commit 98c7467194

View file

@ -1080,25 +1080,28 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193 # tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193
# #
# pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _battery_bar' || true # pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _battery_bar' || true
# case "$status_left $status_right" in # _battery_info
# *'#{battery_status}'*|*'#{battery_bar}'*|*'#{battery_hbar}'*|*'#{battery_vbar}'*|*'#{battery_percentage}'*) # if [ "$charge" != 0 ]; then
# status_left=$(echo "$status_left" | sed -E \ # case "$status_left $status_right" in
# -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \ # *'#{battery_status}'*|*'#{battery_bar}'*|*'#{battery_hbar}'*|*'#{battery_vbar}'*|*'#{battery_percentage}'*)
# -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \ # status_left=$(echo "$status_left" | sed -E \
# -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \ # -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \
# -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \ # -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \
# -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g') # -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \
# status_right=$(echo "$status_right" | sed -E \ # -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \
# -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \ # -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g')
# -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \ # status_right=$(echo "$status_right" | sed -E \
# -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \ # -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \
# -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \ # -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \
# -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g') # -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \
# interval=60 # -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \
# tmux run -b "trap 'exit 0' TERM; while :; do nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done" # -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g')
# status_right="#(printf '\n'; nice cut -c3- ~/.tmux.conf | sh -s _battery_status \"$tmux_conf_battery_status_charging\" \"$tmux_conf_battery_status_discharging\")$status_right" # interval=60
# ;; # tmux run -b "trap 'exit 0' TERM; while :; do nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done"
# esac # status_right="#(printf '\n'; nice cut -c3- ~/.tmux.conf | sh -s _battery_status \"$tmux_conf_battery_status_charging\" \"$tmux_conf_battery_status_discharging\")$status_right"
# ;;
# esac
# fi
# #
# case "$status_left $status_right" in # case "$status_left $status_right" in
# *'#{username}'*|*'#{hostname}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*) # *'#{username}'*|*'#{hostname}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*)