Merge pull request #55 from aapit/master

added option to hide timezone
This commit is contained in:
Dane Williams 2020-08-01 16:38:07 -07:00 committed by GitHub
commit fcd8a5589d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -22,6 +22,7 @@ Customize the status bar by adding any of these lines to your .tmux.conf as desi
* Enable powerline symbols: `set -g @dracula-show-powerline true` * Enable powerline symbols: `set -g @dracula-show-powerline true`
* Switch powerline symbols `set -g @dracula-show-left-sep ` for left and `set -g @dracula-show-right-sep ` for right symbol (can set any symbol you like as seperator) * Switch powerline symbols `set -g @dracula-show-left-sep ` for left and `set -g @dracula-show-right-sep ` for right symbol (can set any symbol you like as seperator)
* Enable military time: `set -g @dracula-military-time true` * 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. * Switch the left smiley icon `set -g @dracula-show-left-icon session` it can accept `session`, `smiley`, `window`, or any character.
* Enable high contrast pane border: `set -g @dracula-border-contrast true` * Enable high contrast pane border: `set -g @dracula-border-contrast true`
* Enable cpu usage: `set -g @dracula-cpu-usage true` * Enable cpu usage: `set -g @dracula-cpu-usage true`

View file

@ -24,6 +24,7 @@ main()
show_powerline=$(get_tmux_option "@dracula-show-powerline" false) show_powerline=$(get_tmux_option "@dracula-show-powerline" false)
show_left_icon=$(get_tmux_option "@dracula-show-left-icon" smiley) show_left_icon=$(get_tmux_option "@dracula-show-left-icon" smiley)
show_military=$(get_tmux_option "@dracula-military-time" false) 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") show_left_sep=$(get_tmux_option "@dracula-show-left-sep")
show_right_sep=$(get_tmux_option "@dracula-show-right-sep") show_right_sep=$(get_tmux_option "@dracula-show-right-sep")
show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false) show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false)
@ -67,7 +68,15 @@ main()
if $show_weather; then if $show_weather; then
$current_dir/sleep_weather.sh $show_fahrenheit & $current_dir/sleep_weather.sh $show_fahrenheit &
fi fi
# Set timezone unless hidden by configuration
case $show_timezone in
false)
timezone="";;
true)
timezone="#(date +%Z)";;
esac
# sets refresh interval to every 5 seconds # sets refresh interval to every 5 seconds
tmux set-option -g status-interval 5 tmux set-option -g status-interval 5
@ -131,9 +140,9 @@ main()
fi fi
if $show_military; then # military time if $show_military; then # military time
tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %R #(date +%Z) " tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %R ${timezone} "
else else
tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p ${timezone} "
fi fi
tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W #[fg=${dark_purple},bg=${gray}]${left_sep}" tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W #[fg=${dark_purple},bg=${gray}]${left_sep}"
@ -168,9 +177,9 @@ main()
fi fi
if $show_military; then # military time if $show_military; then # military time
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %R #(date +%Z) " tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %R ${timezone} "
else else
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p ${timezone} "
fi fi
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W " tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W "