aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-01-05 12:15:52 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-01-05 12:15:52 +0300
commit550db296de8c9ce93bb9b451c93efb43fe67db4d (patch)
treeb614ca5cfc9a61ce42661f44a434823be5775ee5 /powerlevel9k.zsh-theme
parent6d116ab24b974cc8271eaf33c755a916a6f462e4 (diff)
Updates to `prompt_date` and `prompt_time`
Using `set_default` to set the defaults - makes the code shorter and more readable and bypasses errors.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme14
1 files changed, 4 insertions, 10 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 725e726f..d38af031 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1300,23 +1300,17 @@ build_test_stats() {
################################################################
# System time
prompt_time() {
- local time_format="%D{%H:%M:%S}"
- if [[ -n "$POWERLEVEL9K_TIME_FORMAT" ]]; then
- time_format="$POWERLEVEL9K_TIME_FORMAT"
- fi
+ set_default POWERLEVEL9K_TIME_FORMAT "%D{%H:%M:%S}"
- "$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
prompt_date() {
- local date_format="%D{%d.%m.%y}"
- if [[ -n "$POWERLEVEL9K_DATE_FORMAT" ]]; then
- time_format="$POWERLEVEL9K_DATE_FORMAT"
- fi
+ set_default POWERLEVEL9K_DATE_FORMAT "%D{%d.%m.%y}"
- "$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"
}
################################################################