feat: add mode indicator

This commit is contained in:
technofab 2025-06-17 12:14:40 +02:00
parent 2935a9ea7f
commit feef9a9d6d
No known key found for this signature in database
2 changed files with 59 additions and 6 deletions

View file

@ -49,7 +49,8 @@ declare -A plugin_colors=(
["time"]="light_blue text"
["pomodoro"]="red text"
["window"]="bg_main blue"
["current"]="bg_main blue"
["current"]="green text"
["mode"]="duo_bg blue"
)
get_plugin_colors() {
@ -167,7 +168,8 @@ set_theme() {
["time"]="text light_blue"
["pomodoro"]="text red"
["window"]="blue bg_main"
["current"]="blue bg_main"
["current"]="text red"
["mode"]="blue bg_main"
)
fi
}
@ -206,6 +208,10 @@ status_bar() {
IFS=' ' read -r -a colors <<<"$(get_plugin_colors "$plugin")"
script="#($current_dir/$plugin.sh)"
# the mode module adds it's own spaces
if [ "$plugin" != "mode" ]; then
script=" $script "
fi
if [ "$side" == "left" ]; then
if $show_powerline; then
@ -213,18 +219,18 @@ status_bar() {
IFS=' ' read -r -a next_colors <<<"$(get_plugin_colors "$next_plugin")"
pl_bg=${!next_colors[0]:-$bg_main}
tmux set-option -ga status-left \
"#[fg=${!colors[1]},bg=${!colors[0]}] $script #[fg=${!colors[0]},bg=${pl_bg},nobold,nounderscore,noitalics]${l_sep}"
"#[fg=${!colors[1]},bg=${!colors[0]}]$script#[fg=${!colors[0]},bg=${pl_bg},nobold,nounderscore,noitalics]${l_sep}"
pl_bg=${bg_main}
else
tmux set-option -ga status-left "#[fg=${!colors[1]},bg=${!colors[0]}] $script "
tmux set-option -ga status-left "#[fg=${!colors[1]},bg=${!colors[0]}]$script"
fi
else
if $show_powerline; then
tmux set-option -ga status-right \
"#[fg=${!colors[0]},bg=${pl_bg},nobold,nounderscore,noitalics]${r_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script "
"#[fg=${!colors[0]},bg=${pl_bg},nobold,nounderscore,noitalics]${r_sep}#[fg=${!colors[1]},bg=${!colors[0]}]$script"
pl_bg=${!colors[0]}
else
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}] $script "
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}]$script"
fi
fi
done