aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-09-20 22:24:37 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-09-20 22:24:37 +0300
commit4602e948c98e77e49ae182f1802a4576f78bf859 (patch)
treecbfc10f7a71457500aa0f9e4aef692167020204b /powerlevel9k.zsh-theme
parent6cec4ce40059fe4b1450794f20f7ab5fbda0735d (diff)
There is now no difference between longstatus and status any more. Just use status, and if you just want to display it conditionally set POWERLEVEL9K_STATUS_VERBOSE=false.
Also here I unified the use of named color codes to make the subsegment-display work.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme54
1 files changed, 24 insertions, 30 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 86fc2c42..ca293484 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -41,6 +41,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SEGMENT_SEPARATOR $'\UE0B2' # 
LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' # 
+ CARRIAGE_RETURN_ICON $'\U21B5' # ↵
ROOT_ICON $'\UE801' # 
RUBY_ICON $'\UE847' # 
AWS_ICON $'\UE895' # 
@@ -88,6 +89,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SEGMENT_SEPARATOR $'\uE0B2' # 
LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' # 
+ CARRIAGE_RETURN_ICON $'\U21B5' # ↵
ROOT_ICON $'\u26A1' # ⚡
RUBY_ICON ''
AWS_ICON 'AWS:'
@@ -692,27 +694,6 @@ prompt_load() {
fi
}
-# Right Status: (return code, root status, background jobs)
-# This creates a status segment for the *right* prompt. Exact same thing as
-# above - just other side.
-prompt_longstatus() {
- local symbols bg
- symbols=()
-
- if [[ "$RETVAL" -ne 0 ]]; then
- symbols+="%F{226}$RETVAL ↵%f"
- bg="009"
- else
- symbols+="%F{046}$(print_icon 'OK_ICON')%f"
- bg="008"
- fi
-
- [[ "$UID" -eq 0 ]] && symbols+="%F{yellow} $(print_icon 'ROOT_ICON')%f"
- [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%F{cyan}$(print_icon 'BACKGROUND_JOBS_ICON')%f"
-
- [[ -n "$symbols" ]] && "$1_prompt_segment" "$0" "$bg" "white" "$symbols"
-}
-
# Node version
prompt_node_version() {
local nvm_prompt
@@ -724,7 +705,7 @@ prompt_node_version() {
# print a little OS icon
prompt_os_icon() {
- "$1_prompt_segment" "$0" "008" "255" "$OS_ICON"
+ "$1_prompt_segment" "$0" "black" "255" "$OS_ICON"
}
# print PHP version number
@@ -764,16 +745,29 @@ prompt_rvm() {
fi
}
-# Left Status: (return code, root status, background jobs)
-# This creates a status segment for the *left* prompt
+# Status: (return code, root status, background jobs)
+set_default POWERLEVEL9K_STATUS_VERBOSE true
prompt_status() {
- local symbols
+ local symbols bg
symbols=()
- [[ "$RETVAL" -ne 0 ]] && symbols+="%{%F{red}%}$(print_icon 'FAIL_ICON')"
- [[ "$UID" -eq 0 ]] && symbols+="%{%F{yellow}%} $(print_icon 'ROOT_ICON')"
- [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$(print_icon 'BACKGROUND_JOBS_ICON')"
- [[ -n "$symbols" ]] && "$1_prompt_segment" "$0" "$DEFAULT_COLOR" "default" "$symbols"
+ if [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then
+ if [[ "$RETVAL" -ne 0 ]]; then
+ symbols+="%F{226}$RETVAL $(print_icon 'CARRIAGE_RETURN_ICON')%f"
+ bg="red"
+ else
+ symbols+="%F{046}$(print_icon 'OK_ICON')%f"
+ bg="black"
+ fi
+ else
+ [[ "$RETVAL" -ne 0 ]] && symbols+="%{%F{red}%}$(print_icon 'FAIL_ICON')%f"
+ bg="$DEFAULT_COLOR"
+ fi
+
+ [[ "$UID" -eq 0 ]] && symbols+="%{%F{yellow}%} $(print_icon 'ROOT_ICON')%f"
+ [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$(print_icon 'BACKGROUND_JOBS_ICON')%f"
+
+ [[ -n "$symbols" ]] && "$1_prompt_segment" "$0" "$bg" "white" "$symbols"
}
# Symfony2-PHPUnit test ratio
@@ -848,7 +842,7 @@ build_left_prompt() {
# Right prompt
build_right_prompt() {
- defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(longstatus history time)
+ defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time)
for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do
"prompt_$element" "right"