Created
October 23, 2011 02:49
-
-
Save RustingSword/1306793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last=0 | |
cur=0 | |
while [ : ] | |
do | |
mailcheck | grep new 2>&1 >/dev/null | |
if [ $? -eq 0 ] | |
then | |
cur=$(mailcheck | awk 'BEGIN {sum=0} ; $4~/new/ {sum=sum+1}; END {print sum}') | |
if [ $cur -ne $last ] | |
then | |
notify-send "<span color=\"green\" size=\"16000\">New Mail: $cur</span>" -t 300000 | |
last=$cur | |
fi | |
fi | |
sleep 300 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment