Make jobs and rangerlevel indicators less annoying 💢
This commit is contained in:
parent
2a023759f4
commit
e455d85b73
1 changed files with 9 additions and 9 deletions
18
bashrc
18
bashrc
|
@ -30,36 +30,36 @@ set -o vi
|
||||||
|
|
||||||
rlevel() {
|
rlevel() {
|
||||||
if [ -n "$RANGER_LEVEL" ]
|
if [ -n "$RANGER_LEVEL" ]
|
||||||
then if [ "$RANGER_LEVEL" = 1 ]
|
then if [ "$RANGER_LEVEL" -gt 1 ] && [ ! -z "$2" ]
|
||||||
then
|
then
|
||||||
/bin/echo -ne "$1 "
|
/bin/echo -ne "$1$2$RANGER_LEVEL "
|
||||||
else
|
else
|
||||||
/bin/echo -ne "$1×$RANGER_LEVEL "
|
/bin/echo -ne "$1 "
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
numjobs() {
|
numjobs() {
|
||||||
jobs=$(jobs | wc -l)
|
jobs=$(jobs | wc -l)
|
||||||
if [ $jobs -gt 1 ]
|
if [ $jobs -gt 1 ] && [ ! -z "$2" ]
|
||||||
then echo "$1×$jobs "
|
then echo "$1$2$jobs "
|
||||||
elif [ $jobs -gt 0 ]
|
elif [ $jobs -gt 0 ]
|
||||||
then echo "$1 "
|
then echo "$1 "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
export PS1full='\[\033[00;34m\]┌─╼ \[\033[00;37m\]$(numjobs ⚒)\033[00;36m$(rlevel 🥆)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00;34m\] $(gitprompt)
|
export PS1full='\[\033[00;34m\]┌─╼ \[\033[00;37m\]$(numjobs ⚒ " ×")\033[00;36m$(rlevel 🥆 ·)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00;34m\] $(gitprompt)
|
||||||
\[\033[00;34m\]└╼ \[\033[00m\]'
|
\[\033[00;34m\]└╼ \[\033[00m\]'
|
||||||
|
|
||||||
export PS1tiny='\[\033[00;37m\]$(numjobs ⚒)\[\033[00;37m\]$(dirs +0 | sed -e "s/.*\\(\\(\\/.*\\)\\{2\\}\\)$/…\\1/") \[\033[00;36m\]$(rlevel 🥆)\[\033[00;34m\]‣ \[\033[00m\]'
|
export PS1tiny='\[\033[00;37m\]$(numjobs ⚒)\[\033[00;37m\]$(dirs +0 | sed -e "s/.*\\(\\(\\/.*\\)\\{2\\}\\)$/…\\1/") \[\033[00;36m\]$(rlevel 🥆 ·)\[\033[00;34m\]‣ \[\033[00m\]'
|
||||||
|
|
||||||
export PS1nogit='\[\033[00;34m\]┌─╼ \033[00;31m$(rlevel)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00m\]
|
export PS1nogit='\[\033[00;34m\]┌─╼ \033[00;31m$(rlevel)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00m\]
|
||||||
\[\033[00;34m\]└╼ \[\033[00m\]'
|
\[\033[00;34m\]└╼ \[\033[00m\]'
|
||||||
|
|
||||||
export PS1git='\[\033[00;37m\]$(numjobs ⚒)\[\033[00;37m\]$(gitprompt || dirs +0) \[\033[00;36m\]$(gitpath) \[\033[00;36m\]$(rlevel 🥆)
|
export PS1git='\[\033[00;37m\]$(numjobs ⚒)\[\033[00;37m\]$(gitprompt || dirs +0) \[\033[00;36m\]$(gitpath) \[\033[00;36m\]$(rlevel 🥆 ·)
|
||||||
\[\033[00;34m\]↳ \[\033[00m\]'
|
\[\033[00;34m\]↳ \[\033[00m\]'
|
||||||
|
|
||||||
export PS1gitlong='\[\033[00;37m\]$(numjobs ⚒)\[\033[00;37m\]$(gitprompt || dirs +0) \[\033[00;37m\]$(git log --oneline --no-decorate -1 2>/dev/null) \[\033[00;36m\]$(rlevel 🥆)
|
export PS1gitlong='\[\033[00;37m\]$(numjobs ⚒ ·)\[\033[00;37m\]$(gitprompt || dirs +0) \[\033[00;37m\]$(git log --oneline --no-decorate -1 2>/dev/null) \[\033[00;36m\]$(rlevel 🥆 ·)
|
||||||
\[\033[00;36m\]$(gitpath)\[\033[00;31m\]» \[\033[00m\]'
|
\[\033[00;36m\]$(gitpath)\[\033[00;31m\]» \[\033[00m\]'
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
|
Loading…
Reference in a new issue