Merge pull request #75 from spoulson/47_window-flags

47: Enable window flags with `set -g @dracula-show-flags true`.
This commit is contained in:
Ethan Edwards 2020-10-07 03:47:22 -04:00 committed by GitHub
commit e18c92743f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 9 deletions

View file

@ -21,6 +21,7 @@ Customize the status bar by adding any of these lines to your .tmux.conf as desi
* Switch from default fahrenheit to celsius: `set -g @dracula-show-fahrenheit false` * Switch from default fahrenheit to celsius: `set -g @dracula-show-fahrenheit false`
* 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 window flags: `set -g @dracula-show-flags true`
* Adjust the refresh rate for the bar `set -g @dracula-refresh-rate 5` the default is 5, it can accept any number * Adjust the refresh rate for the bar `set -g @dracula-refresh-rate 5` the default is 5, it can accept any number
* 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` * Disable timezone: `set -g @dracula-show-timezone false`

View file

@ -22,6 +22,7 @@ main()
show_weather=$(get_tmux_option "@dracula-show-weather" true) show_weather=$(get_tmux_option "@dracula-show-weather" true)
show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true) show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true)
show_powerline=$(get_tmux_option "@dracula-show-powerline" false) 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=$(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_timezone=$(get_tmux_option "@dracula-show-timezone" true)
@ -80,6 +81,15 @@ main()
timezone="#(date +%Z)";; timezone="#(date +%Z)";;
esac esac
case $show_flags in
false)
flags=""
current_flags="";;
true)
flags="#{?window_flags,#[fg=${dark_purple}]#{window_flags},}"
current_flags="#{?window_flags,#[fg=${light_purple}]#{window_flags},}"
esac
# sets refresh interval to every 5 seconds # sets refresh interval to every 5 seconds
tmux set-option -g status-interval $show_refresh tmux set-option -g status-interval $show_refresh
@ -163,7 +173,7 @@ main()
fi fi
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${current_flags} #[fg=${dark_purple},bg=${gray}]${left_sep}"
# Non Powerline Configuration # Non Powerline Configuration
else else
@ -206,11 +216,13 @@ main()
fi fi
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${current_flags} "
fi fi
tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${gray}] #I #W " tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${gray}] #I #W${flags}"
tmux set-window-option -g window-status-activity-style "bold"
tmux set-window-option -g window-status-bell-style "bold"
} }
# run main function # run main function