You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. #!/usr/bin/bash
  2. #run OfflineIMAP once, with quiet interface
  3. offlineimap -o -q -u quiet
  4. #count new mail for every maildir
  5. maildirnew="$HOME/Maildir/*/*/new/"
  6. new="$(find $maildirnew -type f | wc -l)"
  7. #count old mail for every maildir
  8. maildirold="$HOME/Maildir/*/*/cur/"
  9. old="$(find $maildirold -type f | wc -l)"
  10. if [ $new -gt 0 ]
  11. then
  12. export DISPLAY=:0; export XAUTHORITY=~/.Xauthority;
  13. notify-send -t 5000 -i /home/shaggy/bin/icons/smileicon.png -a "OfflineIMAP" "New: $new Old: $old"
  14. fi