From 30aee63f2217261b423c1cf02a86e25c88a9033f Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 2 Apr 2015 02:19:08 +0200 Subject: Time format is now configurable. --- powerlevel9k.zsh-theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 443f7cc3..76b1ac33 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -277,7 +277,12 @@ prompt_longstatus() { # System time prompt_time() { - $1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR '%D{%H:%M:%S} ' + local time_format='%D{%H:%M:%S} ' + if [[ -n $POWERLEVEL9K_TIME_FORMAT ]]; then + time_format=$POWERLEVEL9K_TIME_FORMAT + fi + + $1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR $time_format } # Command number (in local history) -- cgit v1.2.3 From 2058e56be5b09c47dbfad3cc1f28f35dad01ec69 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Fri, 3 Apr 2015 16:46:42 +0200 Subject: Always add a whitespace to the end of the time segment for better look. --- powerlevel9k.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index f15010c8..27c547f8 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -301,12 +301,12 @@ prompt_longstatus() { # System time prompt_time() { - local time_format='%D{%H:%M:%S} ' + local time_format='%D{%H:%M:%S}' if [[ -n $POWERLEVEL9K_TIME_FORMAT ]]; then time_format=$POWERLEVEL9K_TIME_FORMAT fi - $1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR $time_format + $1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$time_format " } # Command number (in local history) -- cgit v1.2.3 From 367c354103e88575d5d2801bc95d59f1ba865e88 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Fri, 3 Apr 2015 16:49:54 +0200 Subject: Added documentation. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0dd20689..dd0e06f4 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,14 @@ elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`: export DEFAULT_USER= +#### The 'time' segment + +By default the time is show in 'H:M:S' format. If you want to change it, +just set another format in your `~/.zshrc`: + + # Reversed time format + POWERLEVEL9K_TIME_FORMAT='%D{%S:%M:%H}' + #### The VCS Information Segment By default, the `vcs` segment will provide quite a bit of information. If you -- cgit v1.2.3