summaryrefslogtreecommitdiff
path: root/01_Functions.zsh
diff options
context:
space:
mode:
Diffstat (limited to '01_Functions.zsh')
-rw-r--r--01_Functions.zsh34
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()