[dev] Gmail watcher from commandline

From: Viola Zoltán <violazoli_AT_gmail.com>
Date: Wed, 26 Jun 2013 00:35:46 -0400

Hi, excuse me for the bad English... I created a simple gmail watcher
script/solution, because the gmail watcher extension to the Firefox no more

 Gmail Watcher — without Firefox, from commandline!

Under Sabayon distro:

emerge fetchmail

 To the $HOME/.fetchmailrc file:

 poll imap.gmail.com port 993 protocol IMAP username "username_AT_gmail.com"
password "MySecretPassword" keep ssl

Create a script:

#! /bin/bash

 UZENET=`fetchmail -f /home/vz/.fetchmailrc --check | tr "(" " " | tr ")" "
" | sed 's/ \+/ /g'`

OSSZESEN=`echo "$UZENET" | cut --delimiter=" " -f1`

OLVASOTT=`echo "$UZENET" | cut --delimiter=" " -f3`


if [[ $OLVASATLAN != 0 ]] ; then

ogg123 -q /Programs/Szkriptjeim/audio/ApuciLeveledJott_hangosabb.ogg


 Save this script to a good place, for ekzample to the

chmod this file as executable.

As root:

gpasswd -a YourUserName cron

gpasswd -a YourUserName crontab

Create a simple text file, with this line:

 */2 * * * * /Programs/Szkriptjeim/0.0.0/bin/levelemjott

 The */2 means, that the script check your emails in every 2 minutes.

Create a $HOME/cron directory, and save into them this textfile above, with
name: "levelemjott".

Write to the $HOME/.xinitrc this line:

crontab /home/YourUserName/cron/levelemjott

Reboot, and enjoy!
Received on Wed Jun 26 2013 - 06:35:46 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 26 2013 - 06:48:02 CEST