Updated right prompt with exit status code

This commit is contained in:
wujtruj
2013-03-13 11:19:29 +01:00
parent 373edf52b4
commit 771cb49012
2 changed files with 33 additions and 4 deletions

View File

@@ -34,7 +34,22 @@ By default, at the right of the powerline are displayed the date and the time.
If you don't want date or time, you can choose what you want to display:
```
POWERLINE_RIGHT="date replacement"
POWERLINE_RIGHT_B="date replacement"
```
If you want to display date next to time:
```
POWERLINE_RIGHT_A="date"
```
If you want to display exit-code of last command next to time:
```
POWERLINE_RIGHT_A="exit-code"
```
If you want to display date or non-zero-exit-code of last command next to time:
```
POWERLINE_RIGHT_A="mixed"
```
If you don't want to display your username (the green or red (root) colors are still there):

View File

@@ -1,7 +1,17 @@
# FreeAgent puts the powerline style in zsh !
if [ "$POWERLINE_RIGHT" = "" ]; then
POWERLINE_RIGHT=%D{%H:%M:%S}
if [ "$POWERLINE_RIGHT_B" = "" ]; then
POWERLINE_RIGHT_B=%D{%H:%M:%S}
fi
if [ "$POWERLINE_RIGHT_A" = "mixed" ]; then
POWERLINE_RIGHT_A=%(?.%D{%d-%m}.%F{133}✘%?)
elif [ "$POWERLINE_RIGHT_A" = "exit-status" ]; then
POWERLINE_RIGHT_A=%(?.%F{118}✔%?.%F{133}✘%?)
elif [ "$POWERLINE_RIGHT_A" = "date" ]; then
POWERLINE_RIGHT_A=%D{%d-%m}
else
POWERLINE_RIGHT_A=""
fi
if [ "$POWERLINE_HIDE_USER_NAME" = "" ]; then
@@ -99,4 +109,8 @@ if [ "$POWERLINE_NO_BLANK_LINE" = "" ]; then
"$PROMPT
fi
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{yellow}"$'\ue0b2'"%k%F{black}%K{yellow} $POWERLINE_RIGHT %f%k"
if [ "$POWERLINE_RIGHT_A" = "" ]; then
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{yellow}"$'\ue0b2'"%k%F{black}%K{yellow} $POWERLINE_RIGHT_B %f%k"
else
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{yellow}"$'\ue0b2'"%k%F{black}%K{yellow} $POWERLINE_RIGHT_B %f%F{240}"$'\ue0b2'"%f%k%K{240}%F{255} $POWERLINE_RIGHT_A %f%k"
fi