Added left icon padding configuration

This commit is contained in:
Daniel Memije 2020-12-16 10:59:24 -06:00
parent 857d57df7c
commit 5b31360b95
No known key found for this signature in database
GPG key ID: B39806329043863D
2 changed files with 10 additions and 4 deletions

View file

@ -28,6 +28,7 @@ Customize the status bar by adding any of these lines to your .tmux.conf as desi
* Enable military time: `set -g @dracula-military-time true`
* Disable timezone: `set -g @dracula-show-timezone false`
* Switch the left smiley icon `set -g @dracula-show-left-icon session` it can accept `session`, `smiley`, `window`, or any character.
* Add padding to the left smiley icon `set -g @dracula-left-icon-padding` default is 1, it can accept any number and 0 disables padding.
* Enable high contrast pane border: `set -g @dracula-border-contrast true`
* Enable cpu usage: `set -g @dracula-cpu-usage true`
* Enable ram usage: `set -g @dracula-ram-usage true`

View file

@ -27,6 +27,7 @@ main()
show_powerline=$(get_tmux_option "@dracula-show-powerline" 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)
show_military=$(get_tmux_option "@dracula-military-time" false)
show_timezone=$(get_tmux_option "@dracula-show-timezone" true)
show_left_sep=$(get_tmux_option "@dracula-show-left-sep")
@ -56,15 +57,19 @@ main()
# Handle left icon configuration
case $show_left_icon in
smiley)
left_icon="☺ ";;
left_icon="☺";;
session)
left_icon="#S ";;
left_icon="#S";;
window)
left_icon="#W ";;
left_icon="#W";;
*)
left_icon="$show_left_icon ";;
left_icon=$show_left_icon;;
esac
# Handle left icon padding
padding="$(seq -f " " -s '' $show_left_icon_padding)"
left_icon="$left_icon$padding"
# Handle powerline option
if $show_powerline; then
right_sep="$show_right_sep"