summaryrefslogtreecommitdiff
path: root/eml
blob: a480d1843cf4e3cf80ea52223b2a55548ae90b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

eml(){
    maildirs="$HOME/Mail/*/INBOX/new/"
    find $maildirs -type f | wc -l
}

case "$1" in
    -n) m=$(eml)
        if ((m > 0)); then
            notify-send "New mail" "$m messages"
        fi
        ;;
    *) eml ;;
esac