1
0
Fork 0
mirror of synced 2024-05-26 20:11:09 -04:00

added #{load_avg}

This commit is contained in:
Yang Tang 2016-11-03 22:26:31 +01:00 committed by Gregory Pakosz
parent f828eafc2b
commit 8390d37ed8
3 changed files with 27 additions and 1 deletions

View file

@ -524,6 +524,20 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# }'
# }
#
# _loadavg() {
# case $(uname -s) in
# *Darwin*)
# tmux set -g @loadavg $(sysctl -q -n vm.loadavg | cut -d' ' -f2)
# ;;
# *Linux*)
# tmux set -g @loadavg $(cut -d' ' -f1 < /proc/loadavg)
# ;;
# *OpenBSD*)
# tmux set -g @loadavg $(sysctl -q -n vm.loadavg | cut -d' ' -f1)
# ;;
# esac
# }
#
# _split_window() {
# tty=${1:-$(tmux display -p '#{pane_tty}')}
# shift
@ -972,6 +986,16 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# ;;
# esac
#
# case "$status_left $status_right" in
# *'#{loadavg}'*)
# status_left=$(echo "$status_left" | sed -E \
# -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"
# ;;
# esac
#
# status_left=$(echo "$status_left" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g')
# status_right=$(echo "$status_right" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g')
#

View file

@ -143,8 +143,9 @@ tmux_conf_theme_right_separator_sub='|'
# - #{battery_status}
# - #{battery_vbar}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{hostname}
# - #{loadavg}
# - #{pairing}
# - #{prefix}
# - #{root}

View file

@ -188,6 +188,7 @@ This configuration supports the following builtin variables:
- `#{hostname}`: SSH aware hostname information
- `#{hostname_ssh}`: SSH aware hostname information, blank when no SSH
connection detected
- `#{loadavg}`: load average
- `#{pairing}`: is session attached to more than one client?
- `#{prefix}`: is prefix being depressed?
- `#{root}`: is current user root?