notmuch-new.sh (433B)
1 #!/bin/bash 2 3 NEW_MAIL=~/temp/new_mail 4 5 if [ -f $NEW_MAIL ] 6 then 7 while true 8 do 9 nice ionice -c 3 chrt --idle 0 /bin/sh -c "notmuch new" 10 # in case an encryption key is now available 11 nice ionice -c 3 chrt --idle 0 /bin/sh -c \ 12 "PINENTRY_USER_DATA=none notmuch reindex tag:encrypted and not tag:encrypted-failed and not property:index.decryption=success" < /dev/null 13 sleep 1 14 inotifywait $NEW_MAIL 15 done 16 fi 17