blob: 033f812b6b17899d08c41f3a0cc37ca2e8006960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/usr/bin/env bash
#
# A wrapper for all email tasks. Examples:
function count {
count=$(notmuch count tag:inbox and tag:unread)
if [[ $count > 0 ]]; then
notify-send "New mail" "$count messages"
else
notify-send "No new mail"
fi
echo $count
}
function tag {
afew -tnv
afew -mnv
echo "re-tagging inbox.."
afew -t tag:inbox
}
case "$1" in
"in") mbsync --all
;;
"out") msmtp-queue -r
;;
"new") notmuch new
;;
"tag") tag
;;
"all")
notify-send "Starting email sync"
msmtp-queue -r
mbsync --all
notmuch new
tag
count
;;
"-h"|"--help")
echo "usage: $0 [in|out|new|tag|all]"
exit 1
;;
*) count
;;
esac
|