1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 21:45:10 +01:00

Attempt to put the #stopped jobs in the prompt, doesn't play well with

prompt colours
This commit is contained in:
Michiel Scholten
2014-11-29 09:25:38 +01:00
parent 7fdacacb0c
commit a2685239d2

13
.bashrc
View File

@@ -61,6 +61,16 @@ hg_ps1() {
hg prompt " \[\033[1;37m\]hg\[\033[0m\] {branch}{status}" 2> /dev/null
}
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 "
}
# gitprompt configuration
# Set config variables first
#GIT_PROMPT_ONLY_IN_REPO=1
@@ -83,6 +93,9 @@ if [ "$color_prompt" = yes ]; then
PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ "
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)$ "