use ifstat for tmux status

This commit is contained in:
David Chen 2021-01-08 10:56:18 +08:00 committed by David Chen
parent a92ace8038
commit 75dd1dc8b1
2 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ run_segment() {
sed="gsed"
fi
data=$(ifstat -z -S -q 1 1)
data=$(ifstat -z -T -S -q 1 1)
interfaces=$(echo -e "${data}" | head -n 1)
flow_data=$(echo -e "${data}" | tail -n 1 | ${sed} "s/\s\{1,\}/,/g")
index=1
@ -27,7 +27,7 @@ run_segment() {
;;
esac
if [ -n "${type}" ]; then
format=$(echo "${format} ${type} ⇊ %5.01f ⇈ %5.01f")
format=$(echo "${format} ${type} ⇊ %5.0f ⇈ %5.0f")
holder=$(echo "${holder},\$$((index)),\$$((index+1))")
fi
index=$((index+2))

View file

@ -33,12 +33,12 @@ export TMUX_POWERLINE_SEG_WEATHER_GREP="/usr/local/bin/ggrep"
if [ -z $TMUX_POWERLINE_LEFT_STATUS_SEGMENTS ]; then
TMUX_POWERLINE_LEFT_STATUS_SEGMENTS=(
#"tmux_session_info 148 234" \
# "tmux_session_info 148 234" \
#"hostname 33 0" \
"ifstat 30 255" \
"ifstat_sys 30 255" \
#"lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
#"wan_ip 24 255" \
# "ifstat_sys 30 255" \
# "lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
# "wan_ip 24 255" \
#"vcs_branch 29 88" \
#"vcs_compare 60 255" \
#"vcs_staged 64 255" \