Got tmux in a better spot, but the script I'm running is slow. I'd like it to update the bandwidth a bit more quickly. Also unsure what else I need in the powerline! But the colors are great for the time being and the active window is working well.

This commit is contained in:
Norm Rasmussen
2024-01-17 16:45:09 -05:00
parent 30bdfe95a3
commit af30d2fa0b
6 changed files with 69 additions and 22 deletions

View File

View File

@ -0,0 +1,30 @@
#!/bin/bash
find_data=$(ifstat -S -q 1 1)
interfaces=$(echo -e "${find_data}" | head -n 1)
final=()
for interface in ${interfaces}; do
has_data=$(ifstat -i ${interface} -S -q 1 1 | tail -n 1 | tr -d '\r' | tr -d ' ')
if [[ "$has_data" != "0.000.00" ]]; then
for int in ${interface}; do
data=$(ifstat -i ${interface} -S -q 1 1)
flow_data=$(echo -e "${data}" | tail -n 1 | tr -d '\r' )
up=${flow_data% *}
down=${flow_data##* }
up=$up | tr -d ' '
down=$down | tr -d ' '
final+=("$int: $up/ $down")
echo $final
done
# OUTPUT="⇈ $up ⇊ $down"
# echo $OUTPUT
fi
done
# data=$(ifstat -i en0 -i en5 -S -q 1 1)
# flow_data=$(echo -e "${data}" | tail -n 1 | tr -d '\r')
# up=${flow_data% *}
# down=${flow_data##* }
# OUTPUT="⇈ $up ⇊ $down"
# echo $OUTPUT

View File

@ -24,6 +24,7 @@ right_sep=''
wanip="~/.dotfiles/tmux/.config/tmux/plugins/wan_ip.sh"
timezones="~/.dotfiles/tmux/.config/tmux/plugins/timezones.sh"
ifstat="~/.dotfiles/tmux/.config/tmux/plugins/ifstat.sh"
set -g status on
@ -37,7 +38,7 @@ set-option -g status-bg ${dark_gray}
# set-option -g status-fg white
set -g status-left-length 50
# set -g status-left-style default
set -g status-left "#[fg=${black},bg=${dark_purple}] #(${wanip}) #[fg=${dark_purple},bg=${dark_gray}]${left_sep}"
set -g status-left "#[fg=${black},bg=${light_purple}] #(${wanip}) #[fg=${light_purple},bg=${green}]${left_sep}#[fg=${black},bg=${green}] #(${ifstat})#[fg=${green},bg=${dark_gray}]${left_sep}"
set -g status-right-length 60
set -g status-right "#[fg=${pink},bg=${dark_gray}]${right_sep}#[fg=${black},bg=${pink}]#(${timezones}) "