os/pkgs/check-mail.nix

15 lines
310 B
Nix

self:
with self; ''
${offlineimap}/bin/offlineimap
for dir in ~/Mail/*
do
unread=$(find "''${dir}/INBOX/" -type f | grep -vE ',[^,]*S[^,]*$')
if [ ! -z "''${unread}" ]; then
inbox=$(basename $dir)
${libnotify}/bin/notify-send "''${inbox} has unread mail"
fi
done
''