您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

offlineimap-notify.sh 501B

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