Created
March 31, 2013 10:10
-
-
Save Etana/5280186 to your computer and use it in GitHub Desktop.
open gmail if there was no new email at last check and now there is ( i execute it in a cron every minute )
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 | |
num_mail=$(wget -q -O - --auth-no-challenge --user=email@gmail.com --password=my_password 'https://mail.google.com/mail/feed/atom' | awk 'gsub(/<\/?fullcount>/, "")') | |
export DISPLAY=:0 | |
if [ -e "/tmp/gmail_opened" ] | |
then | |
if [[ "$num_mail" == "0" ]] | |
then | |
rm "/tmp/gmail_opened" | |
fi | |
else | |
if [[ "$num_mail" != "0" && "$num_mail" != "" ]] | |
then | |
touch "/tmp/gmail_opened" | |
chromium "https://mail.google.com/mail/u/0/?ui=html#inbox" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment