6
6
place_holder=" \#{prefix_highlight}"
7
7
8
8
# Possible configurations
9
- option_scope_config=' @prefix_highlight_option_scope'
10
9
fg_color_config=' @prefix_highlight_fg'
11
10
bg_color_config=' @prefix_highlight_bg'
12
11
output_prefix=' @prefix_highlight_output_prefix'
@@ -23,7 +22,7 @@ empty_attr_config='@prefix_highlight_empty_attr'
23
22
empty_has_affixes=' @prefix_highlight_empty_has_affixes'
24
23
25
24
tmux_option () {
26
- local -r value=$( tmux show-option -Aqv " $1 " )
25
+ local -r value=$( tmux show-option -gqv " $1 " )
27
26
local -r default=" $2 "
28
27
29
28
if [ -n " $value " ]; then
@@ -37,14 +36,6 @@ format_style() {
37
36
echo " #[${1} ]" | sed -e ' s/,/]#[/g'
38
37
}
39
38
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
-
48
39
# Defaults
49
40
default_fg=' colour231'
50
41
default_bg=' colour04'
@@ -58,7 +49,6 @@ default_empty_prompt=''
58
49
59
50
main () {
60
51
local -r \
61
- option_scope=$( tmux_option " $option_scope_config " " g" ) \
62
52
fg_color=$( tmux_option " $fg_color_config " " $default_fg " ) \
63
53
bg_color=$( tmux_option " $bg_color_config " " $default_bg " ) \
64
54
show_copy_mode=$( tmux_option " $show_copy_config " " off" ) \
@@ -104,9 +94,11 @@ main() {
104
94
105
95
local -r highlight=" #{?client_prefix,$prefix_mode ,$fallback }#[default]"
106
96
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 } "
108
99
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 } "
110
102
}
111
103
112
104
main
0 commit comments