Skip to content

Commit

Permalink
made version detection more robust in case tmux executable is renamed…
Browse files Browse the repository at this point in the history
… (2), fixes gpakosz#457
  • Loading branch information
gpakosz committed Mar 12, 2021
1 parent b28558b commit 87d1e2f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
#
# _uname_s=$(uname -s)
#
# _tmux_version=$(tmux -V | tr -cd '0123456789.' | cut -d' ' -f2 | awk -F '.' '{print $1 * 100 + $2}')
# _tmux_version=$(tmux -V | awk '{print ($2+0) * 100}')
#
# _is_enabled() {
# [ x"$1" = x"true" ] || [ x"$1" = x"yes" ] || [ x"$1" = x"enabled" ] || [ x"$1" = x"1" ]
Expand Down Expand Up @@ -1211,9 +1211,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# -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
# if [ $_tmux_version -ge 302 ]; then
# if [ $_tmux_version -ge 320 ]; then
# 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"
# elif [ $_tmux_version -gt 204 ]; then
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(printf '\n'; 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)$status_right"
# else
# status_right="#(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\")$status_right"
Expand Down Expand Up @@ -1264,9 +1264,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# interval=$(tmux show -gv status-interval)
# ;;
# esac
# if [ $_tmux_version -ge 302 ]; then
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap 'exit 0' TERM; while :; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval; done"
# elif [ $_tmux_version -gt 204 ]; then
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(printf '\n'; while :; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval; done)$status_right"
# else
# status_right="#(nice cut -c3- ~/.tmux.conf | sh -s _uptime)$status_right"
Expand All @@ -1282,9 +1282,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# status_right=$(echo "$status_right" | sed -E \
# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
# interval=$(tmux show -gv status-interval)
# if [ $_tmux_version -ge 302 ]; then
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap 'exit 0' TERM; while :; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done"
# elif [ $_tmux_version -gt 204 ]; then
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(printf '\n'; while :; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done)$status_right"
# else
# status_right="#(nice cut -c3- ~/.tmux.conf | sh -s _loadavg)$status_right"
Expand Down Expand Up @@ -1360,7 +1360,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux display 'Done installing tpm and plugins...'
# fi
# "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm"
# if [ -z "$window_active" ] && [ $_tmux_version -lt 204 ]; then
# if [ -z "$window_active" ] && [ $_tmux_version -lt 240 ]; then
# tmux run -b "sleep $(expr $(tmux display -p '#{display-time}') / 500) && tmux set display-time 3000 \; display 'This configuration will soon require tmux 2.4+' \; set -u display-time"
# fi
# }
Expand All @@ -1371,7 +1371,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# if [ -n "$(tmux show -gv '@plugin')" ] || [ -n "$(tmux show -gv '@tpm_plugins')" ]; then
# tmux run -b "cut -c3- ~/.tmux.conf | sh -s __apply_plugins \"$window_active\" \"$tmux_conf_update_plugins_on_launch\" \"$tmux_conf_update_plugins_on_reload\""
# elif [ -z "$window_active" ]; then
# if [ $_tmux_version -lt 204 ]; then
# if [ $_tmux_version -lt 240 ]; then
# tmux run -b 'tmux set display-time 3000 \; display "This configuration will soon require tmux 2.4+" \; set -u display-time'
# fi
# fi
Expand All @@ -1393,7 +1393,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux run -b 'tmux set display-time 3000 \; display "This configuration requires awk" \; set -u display-time \; run "sleep 3" \; kill-server'
# return
# fi
# if [ $_tmux_version -lt 203 ]; then
# if [ $_tmux_version -lt 230 ]; then
# tmux run -b 'tmux set display-time 3000 \; display "This configuration requires tmux 2.3+" \; set -u display-time \; run "sleep 3" \; kill-server'
# return
# fi
Expand Down

0 comments on commit 87d1e2f

Please sign in to comment.