[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:
parent
3c2730d0c4
commit
d771fd88fb
1 changed files with 3 additions and 11 deletions
|
@ -42,13 +42,14 @@ prompt_eriner_end() {
|
||||||
# Each component will draw itself, or hide itself if no information needs to be
|
# Each component will draw itself, or hide itself if no information needs to be
|
||||||
# shown.
|
# shown.
|
||||||
|
|
||||||
# Status: Was there an error? Am I root? Are there background jobs? Who and
|
# Status: Was there an error? Am I root? Are there background jobs? Ranger
|
||||||
# where am I (user@hostname)?
|
# spawned shell? Who and where am I (user@hostname)?
|
||||||
prompt_eriner_status() {
|
prompt_eriner_status() {
|
||||||
local segment=''
|
local segment=''
|
||||||
(( ${RETVAL} )) && segment+=' %F{red}✘'
|
(( ${RETVAL} )) && segment+=' %F{red}✘'
|
||||||
(( ${UID} == 0 )) && segment+=' %F{yellow}⚡'
|
(( ${UID} == 0 )) && segment+=' %F{yellow}⚡'
|
||||||
(( $(jobs -l | wc -l) > 0 )) && segment+=' %F{cyan}⚙'
|
(( $(jobs -l | wc -l) > 0 )) && segment+=' %F{cyan}⚙'
|
||||||
|
(( ${RANGER_LEVEL} )) && segment+=' %F{cyan}r'
|
||||||
if [[ ${USER} != ${DEFAULT_USER} || -n ${SSH_CLIENT} ]]; then
|
if [[ ${USER} != ${DEFAULT_USER} || -n ${SSH_CLIENT} ]]; then
|
||||||
segment+=' %F{%(!.yellow.default)}${USER}@%m'
|
segment+=' %F{%(!.yellow.default)}${USER}@%m'
|
||||||
fi
|
fi
|
||||||
|
@ -57,14 +58,6 @@ prompt_eriner_status() {
|
||||||
fi
|
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.
|
# Pwd: current working directory.
|
||||||
prompt_eriner_pwd() {
|
prompt_eriner_pwd() {
|
||||||
prompt_eriner_segment cyan " %F{black}$(short_pwd) "
|
prompt_eriner_segment cyan " %F{black}$(short_pwd) "
|
||||||
|
@ -83,7 +76,6 @@ prompt_eriner_git() {
|
||||||
prompt_eriner_main() {
|
prompt_eriner_main() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_eriner_status
|
prompt_eriner_status
|
||||||
prompt_eriner_ranger
|
|
||||||
prompt_eriner_pwd
|
prompt_eriner_pwd
|
||||||
prompt_eriner_git
|
prompt_eriner_git
|
||||||
prompt_eriner_end
|
prompt_eriner_end
|
||||||
|
|
Loading…
Reference in a new issue