From 50c63f557d595f66e45c9877c99efe67d02bdcce Mon Sep 17 00:00:00 2001 From: Druxorey Date: Sat, 19 Oct 2024 01:28:47 -0400 Subject: [PATCH 1/4] feat(separator): added option to place separator symbols on the sides of the bar. --- scripts/dracula.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 14363b27..abb18c1b 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -29,6 +29,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_edge_icons=$(get_tmux_option "@dracula-show-edge-icons" false) 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) From 0217a506aa74f98eda37362285b4b228a9c869fe Mon Sep 17 00:00:00 2001 From: Druxorey Date: Sat, 19 Oct 2024 01:30:44 -0400 Subject: [PATCH 2/4] feat(separator): additional if statement to show the 'show_edge_icons' boolean. --- scripts/dracula.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index abb18c1b..d99fdc2a 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -145,7 +145,11 @@ 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=${bg_color}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" + if $show_edge_icons; then + tmux set-option -g status-left "#[bg=${dark_gray},fg=${green}]#{?client_prefix,#[fg=${yellow}],}${show_right_sep}#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${bg_color}]#{?client_prefix,#[fg=${yellow}],}${left_sep} " + else + tmux set-option -g status-left "#[bg=${dark_gray},fg=${green}]#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${bg_color}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" + fi powerbg=${bg_color} else tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}" @@ -306,7 +310,11 @@ main() if $show_powerline; then 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 " + if $show_edge_icons; then + tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${dark_gray},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script #[bg=${dark_gray},fg=${!colors[0]}]${show_left_sep}" + else + tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script " + fi else tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }" fi From 245752ef327a4a4f39e41cb1cc72e585bccdb065 Mon Sep 17 00:00:00 2001 From: Druxorey Date: Wed, 22 Jan 2025 01:07:44 -0400 Subject: [PATCH 3/4] fix: correct tmux `$show_edge_icons` display logic Fixed the logic for setting the `$show_edge_icons` variable when the `$show_empty_plugins` is false. --- scripts/dracula.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 3b980f49..a510008d 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -326,7 +326,11 @@ main() tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script " fi else - tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }" + if $show_edge_icons; then + tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${dark_gray},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script #[bg=${dark_gray},fg=${!colors[0]}]${show_left_sep}" + else + tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }" + fi fi powerbg=${!colors[0]} else From 8745a65f0f63423768b04e238036ebb5c8dc6440 Mon Sep 17 00:00:00 2001 From: Druxorey Date: Wed, 22 Jan 2025 01:38:54 -0400 Subject: [PATCH 4/4] refactor(show_edge_icons): simplify edge icon logic in status-right: Refactored the logic for `$show_edge_icons` in the tmux status-right configuration. The edge icon calculation is now done beforehand, reducing the complexity of the if statements and improving code readability. --- scripts/dracula.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index a510008d..41616d63 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -318,20 +318,19 @@ main() script="#($current_dir/sys_temp.sh)" fi + if $show_edge_icons; then + edge_icons="#[bg=${dark_gray},fg=${!colors[0]}]${show_left_sep}" + background_color="${dark_gray}" + else + background_color="${powerbg}" + fi + if $show_powerline; then if $show_empty_plugins; then - if $show_edge_icons; then - tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${dark_gray},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script #[bg=${dark_gray},fg=${!colors[0]}]${show_left_sep}" - else - tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script " - fi + tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${background_color},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $edge_icons" else - if $show_edge_icons; then - tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${dark_gray},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script #[bg=${dark_gray},fg=${!colors[0]}]${show_left_sep}" - else - tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }" - fi - fi + tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $edge_icons }" + fi powerbg=${!colors[0]} else if $show_empty_plugins; then @@ -340,6 +339,7 @@ main() tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[1]},bg=${!colors[0]}] $script }" fi fi + done # Window option