dracula.sh: add use_arbitrary_time_format and time_format options

This commit is contained in:
Yusuke Uchida 2021-09-18 21:40:30 +09:00
parent d7b836ad27
commit d9b6d00121

View file

@ -24,6 +24,8 @@ main()
show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false) show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false)
show_day_month=$(get_tmux_option "@dracula-day-month" false) show_day_month=$(get_tmux_option "@dracula-day-month" false)
show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5) show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5)
use_arbitrary_time_format=$(get_tmux_option "@arbitrary_time_format" false)
time_format=$(get_tmux_option "@time_format" "Y-%m-%d(%a) %H:%M:%S")
IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather") IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather")
# Dracula Color Pallette # Dracula Color Pallette
@ -181,6 +183,10 @@ main()
if [ $plugin = "time" ]; then if [ $plugin = "time" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white")
case $use_arbitrary_time_format in
false)
script=${time_format}
true)
if $show_day_month && $show_military ; then # military time and dd/mm if $show_day_month && $show_military ; then # military time and dd/mm
script="%a %d/%m %R ${timezone} " script="%a %d/%m %R ${timezone} "
elif $show_military; then # only military time elif $show_military; then # only military time
@ -190,6 +196,7 @@ main()
else else
script="%a %m/%d %I:%M %p ${timezone} " script="%a %m/%d %I:%M %p ${timezone} "
fi fi
esac
fi fi
if $show_powerline; then if $show_powerline; then