diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2012-01-13 12:40:06 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2012-01-13 12:40:06 +0100 |
commit | c70289d898e7aba51d6dbddc1816bf833b1e3d95 (patch) | |
tree | b037fccceef7eb7bb3317bdb00db3b50ca83cb4a /01_Functions.zsh | |
parent | 9559df1ccf7733a378595193064d0ab763e72cbd (diff) |
[Prompts] guilt
Diffstat (limited to '01_Functions.zsh')
-rw-r--r-- | 01_Functions.zsh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index 6a10c86..1dec1c0 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -218,6 +218,37 @@ get_git_branch () echo $my_git_branch } +get_guilt_series () +{ + # Guilt + # + guilt="" + + if cmd_exists guilt + then + applied=$(guilt applied 2>/dev/null | wc -l) + unapplied=$(guilt unapplied 2>/dev/null | wc -l) + if [ $(($applied + $unapplied)) -gt 0 ] + then + guilt=" "$C_$guilt_colors[applied]$_C + while [ $applied -gt 0 ] + do + guilt=$guilt"+" + applied=$(($applied - 1)) + done + guilt=$guilt$C_$guilt_colors[unapplied]$_C + while [ $unapplied -gt 0 ] + do + guilt=$guilt"-" + unapplied=$(($unapplied - 1)) + done + guilt=$guilt$C_$colors[none]$_C + fi + fi + + echo $guilt +} + # We *must* have previously checked that # we obtained a correct GIT branch with # a call to `get_git_branch` @@ -362,6 +393,9 @@ set_prompt_colors () git_colors[not_up_to_date]="$prompt_colors[not_up_to_date];$color[normal]" # git changes in working tree git_colors[init_in_progress]="$color[black];$color[bold]" # initialization git_colors[up_to_date]="$prompt_colors[up_to_date]" # git up-to-date + + guilt_colors[applied]=$git_colors[cached] + guilt_colors[unapplied]=$color[black] } birthdays() |