From 143a0d888800d150593ba8c72a4e7b6c8a2c2885 Mon Sep 17 00:00:00 2001 From: Aaron Kollasch Date: Fri, 28 Oct 2022 01:10:30 -0400 Subject: [PATCH] Add option to show/hide empty plugins --- scripts/dracula.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 2b5e1f4..b8889a2 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -25,6 +25,7 @@ main() show_day_month=$(get_tmux_option "@dracula-day-month" false) show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5) 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 white='#f8f8f2' @@ -193,10 +194,18 @@ main() fi 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]} 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 done