Skip to content

Instantly share code, notes, and snippets.

@typingincolor
Last active October 29, 2015 08:02
Show Gist options
  • Save typingincolor/53bff2b8f96a26a2a921 to your computer and use it in GitHub Desktop.
Save typingincolor/53bff2b8f96a26a2a921 to your computer and use it in GitHub Desktop.
blink if you have mail
#!/bin/bash
function f_curl {
curl -s -X "SEARCH UNSEEN" -k -u $1:$2 --url $3
}
f_curl $username $password imaps://$host/INBOX | awk '{if (NF > 2) system("/usr/local/bin/blink1-tool -q --rgb=#FF0000 --blink 3");}'
f_curl $username $password imaps://$host/INBOX | awk -v host="$host" -F '{print host ":\t", NF - 2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment