From d9b6d00121255ba5d850341da075e7b54933b80c Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 21:40:30 +0900 Subject: [PATCH] dracula.sh: add use_arbitrary_time_format and time_format options --- scripts/dracula.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 2b5e1f4..321a3f1 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -24,6 +24,8 @@ main() show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false) show_day_month=$(get_tmux_option "@dracula-day-month" false) 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") # Dracula Color Pallette @@ -181,15 +183,20 @@ main() if [ $plugin = "time" ]; then IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white") - if $show_day_month && $show_military ; then # military time and dd/mm - script="%a %d/%m %R ${timezone} " - elif $show_military; then # only military time - script="%a %m/%d %R ${timezone} " - elif $show_day_month; then # only dd/mm - script="%a %d/%m %I:%M %p ${timezone} " - else - script="%a %m/%d %I:%M %p ${timezone} " - fi + case $use_arbitrary_time_format in + false) + script=${time_format} + true) + if $show_day_month && $show_military ; then # military time and dd/mm + script="%a %d/%m %R ${timezone} " + elif $show_military; then # only military time + script="%a %m/%d %R ${timezone} " + elif $show_day_month; then # only dd/mm + script="%a %d/%m %I:%M %p ${timezone} " + else + script="%a %m/%d %I:%M %p ${timezone} " + fi + esac fi if $show_powerline; then