diff options
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r-- | 12_Prompts.zsh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 6537b07..6e24bca 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -176,6 +176,21 @@ __ssh_gpg_agents () } PS1_TASKBAR+=(__ssh_gpg_agents) +__get_a_job() +{ + RUNNING_JOBS=$(jobs | grep -c ' running ') + SUSPENDED_JOBS=$(jobs | grep ' suspended ' -c) + SUSPENDED_TTY_JOBS=$(jobs | grep ' suspended (tty' -c) + JOBS=$(($RUNNING_JOBS + $SUSPENDED_JOBS + $SUSPENDED_TTY_JOBS)) + if [ $JOBS -gt 0 ] + then + [ $RUNNING_JOBS -gt 0 ] && for i in {1..$RUNNING_JOBS} ; do echo -n "$C_$color[yellow];$color[bold]$_C+" ; done + [ $SUSPENDED_TTY_JOBS -gt 0 ] && for i in {1..$SUSPENDED_TTY_JOBS} ; do echo -n "$C_$color[magenta]$_C+" ; done + [ $SUSPENDED_JOBS -gt 0 ] && for i in {1..$SUSPENDED_JOBS} ; do echo -n "$C_$color[blue]$_C+" ; done + fi +} +PS1_TASKBAR+=(__get_a_job) + __display () { __debug -n " Display..." |