Fixed field interpolations

This commit is contained in:
Eric Renfro 2018-12-19 13:34:40 -05:00
parent b9f3edd197
commit 9b5b85841d
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -4,7 +4,7 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/helpers.sh" source "$CURRENT_DIR/scripts/helpers.sh"
fields_interpolation=( host_interpolation=(
"\#{hostname}" "\#{hostname}"
"\#{username}" "\#{username}"
"\#{hostname_fg_color}" "\#{hostname_fg_color}"
@ -13,9 +13,9 @@ fields_interpolation=(
"\#{username_bg_color}" "\#{username_bg_color}"
) )
fields_commands=( host_commands=(
"#($CURRENT_DIR/scripts/username.sh)"
"#($CURRENT_DIR/scripts/hostname.sh)" "#($CURRENT_DIR/scripts/hostname.sh)"
"#($CURRENT_DIR/scripts/username.sh)"
"#($CURRENT_DIR/scripts/hostname_fg_color.sh)" "#($CURRENT_DIR/scripts/hostname_fg_color.sh)"
"#($CURRENT_DIR/scripts/hostname_bg_color.sh)" "#($CURRENT_DIR/scripts/hostname_bg_color.sh)"
"#($CURRENT_DIR/scripts/username_fg_color.sh)" "#($CURRENT_DIR/scripts/username_fg_color.sh)"
@ -30,8 +30,8 @@ set_tmux_option() {
do_interpolation() { do_interpolation() {
local all_interpolated="$1" local all_interpolated="$1"
for ((i=0; i<${#cpu_commands[@]}; i++)); do for ((i=0; i<${#host_commands[@]}; i++)); do
all_interpolated=${all_interpolated/${}} all_interpolated=${all_interpolated/${host_interpolation[$i]}/${host_commands[$i]}}
done done
echo "$all_interpolated" echo "$all_interpolated"
} }