Add option to show/hide empty plugins

This commit is contained in:
Aaron Kollasch 2022-10-28 01:10:30 -04:00
parent 79521cc737
commit 143a0d8888
No known key found for this signature in database
GPG key ID: F813CAE853E39883

View file

@ -25,6 +25,7 @@ main()
show_day_month=$(get_tmux_option "@dracula-day-month" false) show_day_month=$(get_tmux_option "@dracula-day-month" false)
show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5) show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5)
IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather") IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather")
show_empty_plugins=$(get_tmux_option "@dracula-show-empty-plugins" true)
# Dracula Color Pallette # Dracula Color Pallette
white='#f8f8f2' white='#f8f8f2'
@ -193,10 +194,18 @@ main()
fi fi
if $show_powerline; then if $show_powerline; then
tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script " if $show_empty_plugins; then
tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script "
else
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }"
fi
powerbg=${!colors[0]} powerbg=${!colors[0]}
else else
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}] $script " if $show_empty_plugins; then
tmux set-option -ga status-right "#[fg=${!colors[1]},bg=${!colors[0]}] $script "
else
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[1]},bg=${!colors[0]}] $script }"
fi
fi fi
done done