mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-11-28 19:25:25 -07:00
Kaj Forney
f7da7f3982
Former-commit-id: d5258c85bc
Former-commit-id: aaf57e63c1976b3960fee717c68c3b09dc1a94ff
36 lines
923 B
Bash
Executable file
36 lines
923 B
Bash
Executable file
#!/bin/bash -
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
source "$CURRENT_DIR/scripts/helpers.sh"
|
|
|
|
download_speed="#($CURRENT_DIR/scripts/download_speed.sh)"
|
|
net_speed="#($CURRENT_DIR/scripts/net_speed.sh)"
|
|
upload_speed="#($CURRENT_DIR/scripts/upload_speed.sh)"
|
|
|
|
download_interpolation="\#{download_speed}"
|
|
net_interpolation="\#{net_speed}"
|
|
upload_interpolation="\#{upload_speed}"
|
|
|
|
do_interpolation() {
|
|
local input=$1
|
|
local result=""
|
|
|
|
result=${input/$download_interpolation/$download_speed}
|
|
result=${result/$net_interpolation/$net_speed}
|
|
result=${result/$upload_interpolation/$upload_speed}
|
|
|
|
echo $result
|
|
}
|
|
|
|
update_tmux_option() {
|
|
local option=$1
|
|
local option_value=$(get_tmux_option "$option")
|
|
local new_option_value=$(do_interpolation "$option_value")
|
|
set_tmux_option "$option" "$new_option_value"
|
|
}
|
|
|
|
main() {
|
|
update_tmux_option "status-right"
|
|
update_tmux_option "status-left"
|
|
}
|
|
main
|