From 5b31360b95af40848b1fc637de64df114e30b128 Mon Sep 17 00:00:00 2001 From: Daniel Memije Date: Wed, 16 Dec 2020 10:59:24 -0600 Subject: [PATCH] Added left icon padding configuration --- INSTALL.md | 1 + scripts/dracula.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index b28c7f3..7720b56 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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` diff --git a/scripts/dracula.sh b/scripts/dracula.sh index f963532..8a2f886 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -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"