Adds unread emails to prompt
This commit is contained in:
parent
f6f7c490b8
commit
dcad943088
1 changed files with 16 additions and 0 deletions
|
@ -160,6 +160,15 @@ prompt_last_exit_code() {
|
|||
fi
|
||||
}
|
||||
|
||||
prompt_email(){
|
||||
unread="$(notmuch count "tag:unread")"
|
||||
if [ "$unread" -gt 0 ]; then
|
||||
echo "🖂 $unread"
|
||||
echo "yellow3"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Draws a seperator
|
||||
# Takes 2 arguments, from color then to color
|
||||
# If only 1 given, assumes it is the last
|
||||
|
@ -226,6 +235,13 @@ set_prompts(){
|
|||
background="$(echo "$segment" | sed -n '2p')"
|
||||
fi
|
||||
|
||||
# Emails
|
||||
segment="$(draw_segment "prompt_email" "$background")"
|
||||
if [ -n "$(echo "$segment" | sed -n '1p')" ];then
|
||||
PROMPT="$PROMPT$(echo "$segment" | sed -n '1p')"
|
||||
background="$(echo "$segment" | sed -n '2p')"
|
||||
fi
|
||||
|
||||
# Git
|
||||
segment="$(draw_segment "prompt_git" "$background")"
|
||||
if [ -n "$(echo "$segment" | sed -n '1p')" ];then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue