From 3676bfc6484fd44d186c1a8dc50c86b444259dba Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sun, 28 Jul 2019 16:07:56 +0200 Subject: [PATCH] made loadavg status update at most every 'status-interval' seconds also, stopped updating when no client is attached --- .tmux.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index c4e9851..c348ebe 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1181,7 +1181,9 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') # status_right=$(echo "$status_right" | sed -E \ # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') -# status_right="#(cut -c3- ~/.tmux.conf | sh -s _loadavg)$status_right" +# interval=$(tmux show -gv status-interval) +# pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _loadavg' || true +# status_right="#(printf '\n'; while [ \$(tmux display -p '##{session_attached}') -gt 0 ]; do cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done)$status_right" # ;; # esac #