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 diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 1ac02d6d..27c547f8 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -301,7 +301,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)