From 40a80da3f04edaeb3e3d2043c862e0dc9d684c0d Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 18 Apr 2018 08:20:30 +0200 Subject: [PATCH] newmail script --- email/.config/offlineimap/config | 2 +- email/.mutt/force_sync.sh | 7 +------ email/.mutt/newmail.sh | 6 ++++++ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100755 email/.mutt/newmail.sh 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 -- 2.20.1