Skip to content

Commit 7407765

Browse files
Merge pull request #306 from druxorey/feat/edge-icons
feature/ enhancement: custom start and end of tmux status bar options
2 parents 3d9a8b1 + 9c52a41 commit 7407765

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

docs/CONFIG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ Enable powerline symbols
9090
set -g @dracula-show-powerline true
9191
```
9292

93+
Enable edge icons
94+
```bash
95+
set -g @dracula-show-edge-icons true
96+
```
97+
9398
Switch powerline symbols
9499

95100
```bash

scripts/dracula.sh

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export LC_ALL=en_US.UTF-8
55
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
source $current_dir/utils.sh
77

8-
main()
9-
{
8+
main() {
109
# set configuration option variables
1110
show_krbtgt_label=$(get_tmux_option "@dracula-krbtgt-context-label" "")
1211
krbtgt_principal=$(get_tmux_option "@dracula-krbtgt-principal" "")
@@ -29,6 +28,7 @@ main()
2928
show_timezone=$(get_tmux_option "@dracula-show-timezone" true)
3029
show_left_sep=$(get_tmux_option "@dracula-show-left-sep")
3130
show_right_sep=$(get_tmux_option "@dracula-show-right-sep")
31+
show_edge_icons=$(get_tmux_option "@dracula-show-edge-icons" false)
3232
show_inverse_divider=$(get_tmux_option "@dracula-inverse-divider")
3333
show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false)
3434
show_day_month=$(get_tmux_option "@dracula-day-month" false)
@@ -61,15 +61,27 @@ main()
6161

6262
# Set transparency variables - Colors and window dividers
6363
if $transparent_powerline_bg; then
64-
bg_color="default"
65-
window_sep_fg=${dark_purple}
66-
window_sep_bg=default
67-
window_sep="$show_inverse_divider"
64+
bg_color="default"
65+
if $show_edge_icons; then
66+
window_sep_fg=${dark_purple}
67+
window_sep_bg=default
68+
window_sep="$show_right_sep"
69+
else
70+
window_sep_fg=${dark_purple}
71+
window_sep_bg=default
72+
window_sep="$show_inverse_divider"
73+
fi
6874
else
6975
bg_color=${gray}
70-
window_sep_fg=${gray}
71-
window_sep_bg=${dark_purple}
72-
window_sep="$show_left_sep"
76+
if $show_edge_icons; then
77+
window_sep_fg=${dark_purple}
78+
window_sep_bg=${gray}
79+
window_sep="$show_inverse_divider"
80+
else
81+
window_sep_fg=${gray}
82+
window_sep_bg=${dark_purple}
83+
window_sep="$show_left_sep"
84+
fi
7385
fi
7486

7587
# Handle left icon configuration
@@ -150,7 +162,11 @@ main()
150162

151163
# Status left
152164
if $show_powerline; then
153-
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}"
165+
if $show_edge_icons; then
166+
tmux set-option -g status-left "#[bg=${bg_color},fg=${green},bold]#{?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} "
167+
else
168+
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}"
169+
fi
154170
powerbg=${bg_color}
155171
else
156172
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}"
@@ -313,12 +329,20 @@ main()
313329
script="#($current_dir/sys_temp.sh)"
314330
fi
315331

332+
# edge styling
333+
if $show_edge_icons; then
334+
right_edge_icon="#[bg=${bg_color},fg=${!colors[0]}]${show_left_sep}"
335+
background_color=${bg_color}
336+
else
337+
background_color=${powerbg}
338+
fi
339+
316340
if $show_powerline; then
317341
if $show_empty_plugins; then
318-
tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script "
342+
tmux set-option -ga status-right " #[fg=${!colors[0]},bg=${background_color},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $right_edge_icon"
319343
else
320-
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script }"
321-
fi
344+
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[0]},nobold,nounderscore,noitalics] ${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script $right_edge_icon}"
345+
fi
322346
powerbg=${!colors[0]}
323347
else
324348
if $show_empty_plugins; then
@@ -327,6 +351,7 @@ main()
327351
tmux set-option -ga status-right "#{?#{==:$script,},,#[fg=${!colors[1]},bg=${!colors[0]}] $script }"
328352
fi
329353
fi
354+
330355
done
331356

332357
# Window option

0 commit comments

Comments
 (0)