From eee6e911d20d7de347eae7acfa6b6f635ffa2ac7 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 2 Mar 2017 07:53:45 -0500 Subject: [PATCH] Add Ranger segment to eriner theme instead of having the Ranger indicator at the status segment, likewise the magicmace theme. --- modules/prompt/themes/eriner.zsh-theme | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/prompt/themes/eriner.zsh-theme b/modules/prompt/themes/eriner.zsh-theme index 8fea4e4..5fd0097 100644 --- a/modules/prompt/themes/eriner.zsh-theme +++ b/modules/prompt/themes/eriner.zsh-theme @@ -42,14 +42,13 @@ prompt_eriner_end() { # Each component will draw itself, or hide itself if no information needs to be # shown. -# Status: Was there an error? Am I root? Are there background jobs? Ranger -# spawned shell? Who and where am I (user@hostname)? +# Status: Was there an error? Am I root? Are there background jobs? Who and +# where am I (user@hostname)? prompt_eriner_status() { local segment='' (( ${RETVAL} )) && segment+=' %F{red}✘' (( ${UID} == 0 )) && segment+=' %F{yellow}⚡' (( $(jobs -l | wc -l) > 0 )) && segment+=' %F{cyan}⚙' - (( ${RANGER_LEVEL} )) && segment+=' %F{cyan}r' if [[ ${USER} != ${DEFAULT_USER} || -n ${SSH_CLIENT} ]]; then segment+=' %F{%(!.yellow.default)}${USER}@%m' fi @@ -58,6 +57,14 @@ prompt_eriner_status() { fi } +# Ranger: , which can spawn a shell under its +# own process. +prompt_eriner_ranger() { + if (( ${RANGER_LEVEL} )); then + prompt_eriner_segment blue ' %F{black}r ' + fi +} + # Pwd: current working directory. prompt_eriner_pwd() { prompt_eriner_segment cyan " %F{black}$(short_pwd) " @@ -76,6 +83,7 @@ prompt_eriner_git() { prompt_eriner_main() { RETVAL=$? prompt_eriner_status + prompt_eriner_ranger prompt_eriner_pwd prompt_eriner_git prompt_eriner_end