diff options
author | Ben Sima <ben@bsima.me> | 2018-07-10 14:17:25 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-07-10 14:17:25 -0700 |
commit | 9ab4be429feb06ae424f82d918f42bc728a382ac (patch) | |
tree | 78a19e2b541a0b903bd58a45c7af6dfdea5d651e | |
parent | 19339609742837c14d25ca280352df569585a26b (diff) |
eml: support notmuch
-rwxr-xr-x | eml | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -1,15 +1,10 @@ #!/usr/bin/env bash -eml(){ - maildirs="$HOME/Mail/*/INBOX/new/" - find $maildirs -type f | wc -l -} +count=$(notmuch search tag:new | wc -l) case "$1" in - -n) m=$(eml) - if ((m > 0)); then - notify-send "New mail" "$m messages" - fi - ;; - *) eml ;; + -n) [[ $count > 0 ]] && notify-send "New mail" "$count messages" ;; + *) echo $count ;; esac + +exit 0; |