From d9b6d00121255ba5d850341da075e7b54933b80c Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 21:40:30 +0900 Subject: [PATCH 1/6] 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 From bca34814a43f902ca0d2147766e6b43dfb49bdd0 Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 21:42:09 +0900 Subject: [PATCH 2/6] dracula.sh: add prefix dracula- --- scripts/dracula.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 321a3f1..61853b5 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -24,8 +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") + use_arbitrary_time_format=$(get_tmux_option "@dracula-arbitrary-time-format" false) + time_format=$(get_tmux_option "@dracula-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 From 4b6bdaf9e26a26d1f95aa159c3220b569eae10d1 Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 21:46:48 +0900 Subject: [PATCH 3/6] dracula.sh: fixed branch --- scripts/dracula.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 61853b5..8845e0c 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -183,10 +183,8 @@ main() if [ $plugin = "time" ]; then IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white") - case $use_arbitrary_time_format in + 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 @@ -196,6 +194,8 @@ main() else script="%a %m/%d %I:%M %p ${timezone} " fi + true) + script=${time_format} esac fi From d4f3009800c500a3b6d7736b58e3c57958f7ad8b Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 22:15:41 +0900 Subject: [PATCH 4/6] dracula.sh: changed default value of time_format --- scripts/dracula.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 8845e0c..799538d 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -25,7 +25,7 @@ main() 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 "@dracula-arbitrary-time-format" false) - time_format=$(get_tmux_option "@dracula-time-format" "Y-%m-%d(%a) %H:%M:%S") + time_format=$(get_tmux_option "@dracula-time-format" "%Y-%m-%d(%a) %H:%M") IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather") # Dracula Color Pallette From c39cc30213d68d6e5cb12e0c0afae76741c0c693 Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 18 Sep 2021 22:15:54 +0900 Subject: [PATCH 5/6] dracula.sh: debug case statement --- scripts/dracula.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 799538d..5e858f2 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -193,9 +193,9 @@ main() script="%a %d/%m %I:%M %p ${timezone} " else script="%a %m/%d %I:%M %p ${timezone} " - fi + fi;; true) - script=${time_format} + script=${time_format};; esac fi From 597f7bed29310bb9546c83315337e1f89a05f7f4 Mon Sep 17 00:00:00 2001 From: Yusuke Uchida Date: Sat, 16 Oct 2021 00:57:10 +0900 Subject: [PATCH 6/6] dracula.sh: deleted use_arbitrary_time_format option --- scripts/dracula.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 5e858f2..c93aa94 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -24,7 +24,6 @@ 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 "@dracula-arbitrary-time-format" false) time_format=$(get_tmux_option "@dracula-time-format" "%Y-%m-%d(%a) %H:%M") IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather") @@ -183,20 +182,19 @@ main() if [ $plugin = "time" ]; then IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white") - case $use_arbitrary_time_format in - false) - 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;; - true) - script=${time_format};; - esac + if [ -n "$time_format" ]; then + script=${time_format} + else + 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 + fi fi if $show_powerline; then