mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 22:55:10 +01:00
Cleanup and added the jobcount to all prompts
This commit is contained in:
14
.bashrc
14
.bashrc
@@ -70,28 +70,24 @@ set_bash_prompt(){
|
|||||||
RED="\[\033[0;31m\]"
|
RED="\[\033[0;31m\]"
|
||||||
PROMPT_SYMBOL='$'
|
PROMPT_SYMBOL='$'
|
||||||
if [ $USER = 'root' ]; then
|
if [ $USER = 'root' ]; then
|
||||||
PS1="$YELLOW\t $RED\u$BLACK@\h:\W# "
|
#PS1="$YELLOW\t $RED\u$BLACK@\h:\W# "
|
||||||
|
PS1="$YELLOW\t $RED\u$BLACK@\h:\W$(jobscount)# "
|
||||||
elif [ -e ~/.dot_is_server ]; then
|
elif [ -e ~/.dot_is_server ]; then
|
||||||
PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ "
|
#PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ "
|
||||||
|
PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$(jobscount)$ "
|
||||||
else
|
else
|
||||||
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ "
|
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ "
|
||||||
#PS1='$PS1$(jobscount)'
|
|
||||||
PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ "
|
PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ "
|
||||||
#PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ '
|
|
||||||
fi
|
fi
|
||||||
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ "
|
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ "
|
||||||
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ "
|
#PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ "
|
||||||
# /Michiel's colour config
|
# /Michiel's colour config
|
||||||
}
|
}
|
||||||
|
|
||||||
function stoppedjobs {
|
|
||||||
jobs -s | wc -l | sed -e "s/ //g"
|
|
||||||
}
|
|
||||||
|
|
||||||
jobscount() {
|
jobscount() {
|
||||||
local stopped=$(jobs -sp | wc -l)
|
local stopped=$(jobs -sp | wc -l)
|
||||||
local running=$(jobs -rp | wc -l)
|
local running=$(jobs -rp | wc -l)
|
||||||
((running+stopped)) && echo -n "${running}r/${stopped}s "
|
((running+stopped)) && echo -n "[${running}r/${stopped}s]"
|
||||||
}
|
}
|
||||||
|
|
||||||
# gitprompt configuration
|
# gitprompt configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user