summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-07-10 14:17:25 -0700
committerBen Sima <ben@bsima.me>2018-07-10 14:17:25 -0700
commit9ab4be429feb06ae424f82d918f42bc728a382ac (patch)
tree78a19e2b541a0b903bd58a45c7af6dfdea5d651e
parent19339609742837c14d25ca280352df569585a26b (diff)
eml: support notmuch
-rwxr-xr-xeml15
1 files changed, 5 insertions, 10 deletions
diff --git a/eml b/eml
index a480d18..1c66260 100755
--- a/eml
+++ b/eml
@@ -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;