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_day_month=$(get_tmux_option "@dracula-day-month" false)
|
||||
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" "")
|
||||
IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-plugins" "battery network weather")
|
||||
|
||||
|
@ -192,14 +193,18 @@ main()
|
|||
|
||||
elif [ $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} "
|
||||
if [ -n "$time_format" ]; then
|
||||
script=${time_format}
|
||||
else
|
||||
script="%a %m/%d %I:%M %p ${timezone} "
|
||||
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
|
||||
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue