You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
719 B
33 lines
719 B
#!/usr/bin/env bash
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
source "$CURRENT_DIR/helpers.sh"
|
|
|
|
ip_address="$($CURRENT_DIR/ip_address.sh)"
|
|
ip_address_interpolation_string="\#{ip_address}"
|
|
|
|
do_interpolation() {
|
|
local string="$1"
|
|
local ip_addr=$ip_address
|
|
if [ -z "$ip_address" ]
|
|
then
|
|
ip_addr="Offline"
|
|
fi
|
|
|
|
local interpolated="$(echo $1 | sed "s/$ip_address_interpolation_string/$ip_addr/g")"
|
|
|
|
echo "$interpolated"
|
|
}
|
|
|
|
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"
|
|
}
|
|
main
|