newmail script
authorMart Lubbers <mart@martlubbers.net>
Wed, 18 Apr 2018 06:20:30 +0000 (08:20 +0200)
committerMart Lubbers <mart@martlubbers.net>
Wed, 18 Apr 2018 06:20:30 +0000 (08:20 +0200)
email/.config/offlineimap/config
email/.mutt/force_sync.sh
email/.mutt/newmail.sh [new file with mode: 0755]

index 1ccd752..cd68eb9 100644 (file)
@@ -9,7 +9,7 @@ localrepository = Local
 remoterepository = Remote
 autorefresh = 0.5
 quick = 10
-postsynchook = notmuch new
+postsynchook = notmuch new && /home/mrl/.mutt/newmail.sh
 #proxy = SOCKS5:localhost:8008
 
 [Repository Local]
index e08a3ac..2459e1e 100755 (executable)
@@ -1,7 +1,2 @@
 #!/bin/sh
-if pidof -x offlineimap
-then
-       kill -10 "$(pidof -x offlineimap)"
-else
-       offlineimap -u quiet -o
-fi
+pidof -x offlineimap | xargs kill -10
diff --git a/email/.mutt/newmail.sh b/email/.mutt/newmail.sh
new file mode 100755 (executable)
index 0000000..ff9ebf6
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+newmail="$(find ~/.mutt/mail/INBOX/new/ -type f | wc -l)"
+if [ "$newmail" -ne 0 ]
+then
+       notify-send "$newmail new emails!"
+fi