66place_holder=" \#{prefix_highlight}"
77
88# Possible configurations
9- option_scope_config=' @prefix_highlight_option_scope'
109fg_color_config=' @prefix_highlight_fg'
1110bg_color_config=' @prefix_highlight_bg'
1211output_prefix=' @prefix_highlight_output_prefix'
@@ -23,7 +22,7 @@ empty_attr_config='@prefix_highlight_empty_attr'
2322empty_has_affixes=' @prefix_highlight_empty_has_affixes'
2423
2524tmux_option () {
26- local -r value=$( tmux show-option -Aqv " $1 " )
25+ local -r value=$( tmux show-option -gqv " $1 " )
2726 local -r default=" $2 "
2827
2928 if [ -n " $value " ]; then
@@ -37,14 +36,6 @@ format_style() {
3736 echo " #[${1} ]" | sed -e ' s/,/]#[/g'
3837}
3938
40- interpolate () {
41- local -r option=$1
42- local -r replacement=$2
43- local -r option_scope=${3# -}
44- local -r option_value=$( tmux_option " $option " )
45- tmux set-option -" $option_scope " q " $option " " ${option_value/ $place_holder / $replacement } "
46- }
47-
4839# Defaults
4940default_fg=' colour231'
5041default_bg=' colour04'
@@ -58,7 +49,6 @@ default_empty_prompt=''
5849
5950main () {
6051 local -r \
61- option_scope=$( tmux_option " $option_scope_config " " g" ) \
6252 fg_color=$( tmux_option " $fg_color_config " " $default_fg " ) \
6353 bg_color=$( tmux_option " $bg_color_config " " $default_bg " ) \
6454 show_copy_mode=$( tmux_option " $show_copy_config " " off" ) \
@@ -104,9 +94,11 @@ main() {
10494
10595 local -r highlight=" #{?client_prefix,$prefix_mode ,$fallback }#[default]"
10696
107- interpolate " status-left" " $highlight " " $option_scope "
97+ local -r status_left_value=" $( tmux_option " status-left" ) "
98+ tmux set-option -gq " status-left" " ${status_left_value/ $place_holder / $highlight } "
10899
109- interpolate " status-right" " $highlight " " $option_scope "
100+ local -r status_right_value=" $( tmux_option " status-right" ) "
101+ tmux set-option -gq " status-right" " ${status_right_value/ $place_holder / $highlight } "
110102}
111103
112104main
0 commit comments