From 71d26a2d3effef26ea8dfcb7920d70241c0b8a34 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 09:44:55 +0100 Subject: [PATCH] Cleanup and added the jobcount to all prompts --- .bashrc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.bashrc b/.bashrc index 68ecc1c..345344d 100644 --- a/.bashrc +++ b/.bashrc @@ -70,28 +70,24 @@ set_bash_prompt(){ RED="\[\033[0;31m\]" PROMPT_SYMBOL='$' 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 - 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 #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$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ ' fi #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ " #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ " # /Michiel's colour config } -function stoppedjobs { - jobs -s | wc -l | sed -e "s/ //g" -} - jobscount() { local stopped=$(jobs -sp | 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