From 2684049b36028c6fb6522fbcd055a55ac2c6c102 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Favreau <8480549+Heyian@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:13:29 -0400 Subject: [PATCH 1/5] Add option for transparent status bar background --- scripts/dracula.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index b9eef058..aba8d84c 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -18,6 +18,7 @@ main() show_location=$(get_tmux_option "@dracula-show-location" true) fixed_location=$(get_tmux_option "@dracula-fixed-location") show_powerline=$(get_tmux_option "@dracula-show-powerline" false) + transparent_bg=$(get_tmux_option "@dracula-transparent-bg" false) show_flags=$(get_tmux_option "@dracula-show-flags" false) show_left_icon=$(get_tmux_option "@dracula-show-left-icon" smiley) show_left_icon_padding=$(get_tmux_option "@dracula-left-icon-padding" 1) @@ -26,6 +27,7 @@ main() show_timezone=$(get_tmux_option "@dracula-show-timezone" true) show_left_sep=$(get_tmux_option "@dracula-show-left-sep" ) show_right_sep=$(get_tmux_option "@dracula-show-right-sep" ) + show_inverse_divider=$(get_tmux_option "@dracula-inverse-divider" ) show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false) show_day_month=$(get_tmux_option "@dracula-day-month" false) show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5) @@ -49,6 +51,15 @@ main() pink='#ff79c6' yellow='#f1fa8c' + # Set color of background + if $transparent_bg; then + bg_color="default" + separator_bg_color="default" + else + bg_color=${gray} + separator_bg_color=${white} + fi + # Handle left icon configuration case $show_left_icon in smiley) @@ -76,6 +87,7 @@ main() if $show_powerline; then right_sep="$show_right_sep" left_sep="$show_left_sep" + inverse_divider="$show_inverse_divider" fi # Set timezone unless hidden by configuration @@ -123,12 +135,12 @@ main() tmux set-option -g message-style "bg=${gray},fg=${white}" # status bar - tmux set-option -g status-style "bg=${gray},fg=${white}" + tmux set-option -g status-style "bg=${bg_color},fg=${white}" # Status left if $show_powerline; then - tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${gray}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" - powerbg=${gray} + tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=default]#{?client_prefix,#[fg=${yellow}],}${left_sep}" + powerbg=default else tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}" fi @@ -295,12 +307,16 @@ main() # Window option if $show_powerline; then + if $transparent_bg; then + tmux set-window-option -g window-status-current-format "#[fg=${dark_purple},bg=default]${inverse_divider}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=default]${left_sep}" + else tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${gray}]${left_sep}" + fi else tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W${current_flags} " fi - tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${gray}] #I #W${flags}" + tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=default] #I #W${flags}" tmux set-window-option -g window-status-activity-style "bold" tmux set-window-option -g window-status-bell-style "bold" } From 87b065808c4815b0730f47dcd13edf545ab0f016 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Favreau <8480549+Heyian@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:16:00 -0400 Subject: [PATCH 2/5] Changed option name --- scripts/dracula.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index aba8d84c..966a6478 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -18,7 +18,7 @@ main() show_location=$(get_tmux_option "@dracula-show-location" true) fixed_location=$(get_tmux_option "@dracula-fixed-location") show_powerline=$(get_tmux_option "@dracula-show-powerline" false) - transparent_bg=$(get_tmux_option "@dracula-transparent-bg" false) + transparent_powerline_bg=$(get_tmux_option "@dracula-transparent-powerline-bg" false) show_flags=$(get_tmux_option "@dracula-show-flags" false) show_left_icon=$(get_tmux_option "@dracula-show-left-icon" smiley) show_left_icon_padding=$(get_tmux_option "@dracula-left-icon-padding" 1) @@ -52,7 +52,7 @@ main() yellow='#f1fa8c' # Set color of background - if $transparent_bg; then + if $transparent_powerline_bg; then bg_color="default" separator_bg_color="default" else @@ -307,7 +307,7 @@ main() # Window option if $show_powerline; then - if $transparent_bg; then + if $transparent_powerline_bg; then tmux set-window-option -g window-status-current-format "#[fg=${dark_purple},bg=default]${inverse_divider}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=default]${left_sep}" else tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${gray}]${left_sep}" From 7cb699889e050345e95abd1b0a09715bf1f217aa Mon Sep 17 00:00:00 2001 From: Marc-Antoine Favreau <8480549+Heyian@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:31:43 -0400 Subject: [PATCH 3/5] Remove unused variable and use bg_color instead of default --- scripts/dracula.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 966a6478..003a65cd 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -54,10 +54,8 @@ main() # Set color of background if $transparent_powerline_bg; then bg_color="default" - separator_bg_color="default" else bg_color=${gray} - separator_bg_color=${white} fi # Handle left icon configuration @@ -139,8 +137,8 @@ main() # Status left if $show_powerline; then - tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=default]#{?client_prefix,#[fg=${yellow}],}${left_sep}" - powerbg=default + tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${bg_color}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" + powerbg=${bg_color} else tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}" fi @@ -308,7 +306,7 @@ main() # Window option if $show_powerline; then if $transparent_powerline_bg; then - tmux set-window-option -g window-status-current-format "#[fg=${dark_purple},bg=default]${inverse_divider}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=default]${left_sep}" + tmux set-window-option -g window-status-current-format "#[fg=${dark_purple},bg=${bg_color}]${inverse_divider}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${bg_color}]${left_sep}" else tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${gray}]${left_sep}" fi @@ -316,7 +314,7 @@ main() tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W${current_flags} " fi - tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=default] #I #W${flags}" + tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${bg_color}] #I #W${flags}" tmux set-window-option -g window-status-activity-style "bold" tmux set-window-option -g window-status-bell-style "bold" } From 538be1807a19c3d882be05c6569cffa1203968bf Mon Sep 17 00:00:00 2001 From: Marc-Antoine Favreau <8480549+Heyian@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:45:45 -0400 Subject: [PATCH 4/5] Remove unnecessary if statement --- scripts/dracula.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 003a65cd..93e0fac0 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -51,11 +51,17 @@ main() pink='#ff79c6' yellow='#f1fa8c' - # Set color of background + # Set transparency variables - Colors and window dividers if $transparent_powerline_bg; then bg_color="default" + window_sep_fg=${dark_purple} + window_sep_bg=default + window_sep="$show_inverse_divider" else bg_color=${gray} + window_sep_fg=${gray} + window_sep_bg=${dark_purple} + window_sep="$show_left_sep" fi # Handle left icon configuration @@ -305,11 +311,7 @@ main() # Window option if $show_powerline; then - if $transparent_powerline_bg; then - tmux set-window-option -g window-status-current-format "#[fg=${dark_purple},bg=${bg_color}]${inverse_divider}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${bg_color}]${left_sep}" - else - tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${gray}]${left_sep}" - fi + tmux set-window-option -g window-status-current-format "#[fg=${window_sep_fg},bg=${window_sep_bg}]${window_sep}#[fg=${white},bg=${dark_purple}] #I #W${current_flags} #[fg=${dark_purple},bg=${bg_color}]${left_sep}" else tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W${current_flags} " fi From a9ba36cb8646dd5053238d42ba3768fe12c95260 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Favreau <8480549+Heyian@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:58:08 -0400 Subject: [PATCH 5/5] Remove unused variable --- scripts/dracula.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 93e0fac0..806795a5 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -91,7 +91,6 @@ main() if $show_powerline; then right_sep="$show_right_sep" left_sep="$show_left_sep" - inverse_divider="$show_inverse_divider" fi # Set timezone unless hidden by configuration