mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 12:20:07 +00:00
Updates to prompt_date
and prompt_time
Using `set_default` to set the defaults - makes the code shorter and more readable and bypasses errors.
This commit is contained in:
parent
6d116ab24b
commit
550db296de
1 changed files with 4 additions and 10 deletions
|
@ -1300,23 +1300,17 @@ build_test_stats() {
|
||||||
################################################################
|
################################################################
|
||||||
# System time
|
# System time
|
||||||
prompt_time() {
|
prompt_time() {
|
||||||
local time_format="%D{%H:%M:%S}"
|
set_default POWERLEVEL9K_TIME_FORMAT "%D{%H:%M:%S}"
|
||||||
if [[ -n "$POWERLEVEL9K_TIME_FORMAT" ]]; then
|
|
||||||
time_format="$POWERLEVEL9K_TIME_FORMAT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$time_format" "TIME_ICON"
|
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$POWERLEVEL9K_TIME_FORMAT" "TIME_ICON"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# System date
|
# System date
|
||||||
prompt_date() {
|
prompt_date() {
|
||||||
local date_format="%D{%d.%m.%y}"
|
set_default POWERLEVEL9K_DATE_FORMAT "%D{%d.%m.%y}"
|
||||||
if [[ -n "$POWERLEVEL9K_DATE_FORMAT" ]]; then
|
|
||||||
time_format="$POWERLEVEL9K_DATE_FORMAT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$date_format" "DATE_ICON"
|
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$POWERLEVEL9K_DATE_FORMAT" "DATE_ICON"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
Loading…
Reference in a new issue