diff --git a/services/notmuch/notmuch b/services/notmuch/notmuch index 517ee48..316aa7c 100755 --- a/services/notmuch/notmuch +++ b/services/notmuch/notmuch @@ -6,6 +6,6 @@ ip route ls | grep -q '.' # check if the gpg-agent is running pgrep gpg-agent > /dev/null -notmuch new --quiet 2>&1 | xargs -0 --no-run-if-empty notify-send +notmuch new --quiet 2>&1 exec sleep 3m diff --git a/yashrc b/yashrc index 0d1f1ea..4ad4ce1 100644 --- a/yashrc +++ b/yashrc @@ -35,6 +35,10 @@ prompt_pwd() { prompt_agent() { [ -z "$SSH_AGENT_PID" ] || echo " (A)" } +prompt_mail() { + unread="$(notmuch count tag:unread)" + [ "$unread" = "0" ] || echo " ($unread mails)" +} prompt_status() { if [ "$?" = "0" ] then echo "$" @@ -47,7 +51,7 @@ prompt_date() { BOLD="\fo." GREEN="\fg." RESET="\fD." -PS1="$BOLD[\$(ks prompt_date)]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git)\$(ks prompt_agent) \$(prompt_status) " +PS1="$BOLD[\$(ks prompt_date)]$RESET $GREEN\$(ks prompt_pwd)$RESET\$(ks prompt_git)\$(ks prompt_agent)\$(ks prompt_mail) \$(prompt_status) " unset BOLD unset GREEN unset RESET @@ -69,6 +73,7 @@ alias agent='eval "$(ssh-agent)" && ssh-add' alias unlock='gpg-connect-agent <<