[prompt] Range segment in eriner as in magicmace

This reverts commit eee6e911d2.

As suggested in
https://github.com/Eriner/zim/pull/142#issuecomment-283806756 (and
"thumb-upped" by Tmplt). The Ranger segment was introduced in eriner
theme by Tmplt in https://github.com/Eriner/zim/pull/64. He also added
it to the magicmace theme.
This commit is contained in:
Eric Nielsen 2017-04-17 16:29:31 -05:00
parent 3c2730d0c4
commit d771fd88fb
1 changed files with 3 additions and 11 deletions

View File

@ -42,13 +42,14 @@ 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? Who and
# where am I (user@hostname)?
# Status: Was there an error? Am I root? Are there background jobs? Ranger
# spawned shell? 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
@ -57,14 +58,6 @@ prompt_eriner_status() {
fi
}
# Ranger: <https://github.com/ranger/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) "
@ -83,7 +76,6 @@ prompt_eriner_git() {
prompt_eriner_main() {
RETVAL=$?
prompt_eriner_status
prompt_eriner_ranger
prompt_eriner_pwd
prompt_eriner_git
prompt_eriner_end