1
0
Fork 0
mirror of synced 2024-12-21 22:31:06 -05:00

made background sleep process exit immediately when exiting tmux (2)

tmux < 2.8 doesn't support #{l:...}
This commit is contained in:
Gregory Pakosz 2021-11-09 19:34:03 +01:00
parent c4220639ff
commit 24f1222307

View file

@ -1210,8 +1210,10 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# interval=60
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; 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 & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -gt 240 ]; then
# elif [ $_tmux_version -ge 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; 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"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; 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"
# fi
@ -1263,8 +1265,10 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# esac
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -gt 240 ]; then
# elif [ $_tmux_version -gt 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval; done)$status_right"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; 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"
# fi
@ -1281,8 +1285,10 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# interval=$(tmux show -gv status-interval)
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -gt 240 ]; then
# elif [ $_tmux_version -gt 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done)$status_right"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; 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"
# fi