From: Mart Lubbers Date: Wed, 18 Apr 2018 06:20:30 +0000 (+0200) Subject: newmail script X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=40a80da3f04edaeb3e3d2043c862e0dc9d684c0d;p=dotfiles.git newmail script --- diff --git a/email/.config/offlineimap/config b/email/.config/offlineimap/config index 1ccd752..cd68eb9 100644 --- a/email/.config/offlineimap/config +++ b/email/.config/offlineimap/config @@ -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] diff --git a/email/.mutt/force_sync.sh b/email/.mutt/force_sync.sh index e08a3ac..2459e1e 100755 --- a/email/.mutt/force_sync.sh +++ b/email/.mutt/force_sync.sh @@ -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 index 0000000..ff9ebf6 --- /dev/null +++ b/email/.mutt/newmail.sh @@ -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