Merge pull request #124 from ucchiee/feature/time/arbitrary_format
Added new options to use arbitrary time format.
This commit is contained in:
commit
96a3984158
1 changed files with 12 additions and 7 deletions
|
@ -24,6 +24,7 @@ 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)
|
||||||
|
time_format=$(get_tmux_option "@dracula-time-format" "%Y-%m-%d(%a) %H:%M")
|
||||||
show_kubernetes_context_label=$(get_tmux_option "@dracula-kubernetes-context-label" "")
|
show_kubernetes_context_label=$(get_tmux_option "@dracula-kubernetes-context-label" "")
|
||||||
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")
|
||||||
|
|
||||||
|
@ -192,6 +193,9 @@ main()
|
||||||
|
|
||||||
elif [ $plugin = "time" ]; then
|
elif [ $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")
|
||||||
|
if [ -n "$time_format" ]; then
|
||||||
|
script=${time_format}
|
||||||
|
else
|
||||||
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
|
||||||
|
@ -201,6 +205,7 @@ main()
|
||||||
else
|
else
|
||||||
script="%a %m/%d %I:%M %p ${timezone} "
|
script="%a %m/%d %I:%M %p ${timezone} "
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue