summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-04-03 19:03:52 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-04-03 19:03:52 +0300
commit56dc536f6c143ca892c1922f5be132c13351c4f2 (patch)
treee2dfd97c26f28ee063d3f0faecbf5a14190ae1f2
parentb1d6d3e67d6f6c936c1150ab5f438813bed0a23a (diff)
parent367c354103e88575d5d2801bc95d59f1ba865e88 (diff)
Merge pull request #20 from dritter/dritter/date_configurable
Better configurability of time format
-rw-r--r--README.md8
-rw-r--r--powerlevel9k.zsh-theme7
2 files changed, 14 insertions, 1 deletions
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=<your username>
+#### 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)