Gmail scripts
Written by edmond in Applications, Bash, Command & Shell, Debian, Gnu-Linux, Graphics, Hardware, Networking, Security, Tips & Tricks, Utilities
To get mail from Gmail I use a script to me very useful, since they are not interested in using mail client, but the maximum-iceweasel plugins for firefox. The particularity of this script is that once controlled the number of new mail received, the LED turns on num lock (or lock or caps lock skroll) and flashes many times, how many emails you receive. The only dependency that is required is blinkd, present in the repository.
apt-get install blinkd
This is the script:
# / bin / bash cd / tmp Vostro_Username_Google_Senza_@gmail.com username = password = $ (zenity - entry - title = "Gmail Password" - text = "Enter password:" - hide-text) if [[ -z $ password]] then exit fi if [[$ password == "0"]] then password = $ (zenity - entry - title = "Gmail Password" - text = "Enter password:") fi sleep 15 function get_rss (wget-q-O. gmail_rss https: / / $ username: $ password@mail.google.com / mail / feed / atom - no-check-certificate fc = $ (cat. gmail_rss | grep "fullCount "| grep-o [1-9])) while true do get_rss if! [[Fc == "0"]] then until [[$ k == ""]] do blink-n-r $ fc get_rss blink sleep 15 fi done sleep 5m done rm-f. Gmail_rss
chmod + x script_name
Course to see the file. Gmail_rss in / tmp need to display hidden files.
The script checks for new mails every 10 minutes, to change just change "sleep 10m"
The LED flashes and the num lock, to edit it just replace blink-n-r $ fc with blink-c-r $ fc and is passed to the CAPSLOCK.
These other options:
-c,-capslockled use Caps-Lock LED
-h,-help display this help and exit
-ms-machine = s let keyboard blink of machine s
-n,-numlockled use Num-Lock LED
-rn,-rate = N SET blink rate to n
-s,-scrolllockled Use Scroll-Lock LED
-tn,-tcp-port = n use tcp port n
-v,-version output version information and exit
To stop or start the daemons / etc / init.d / blinkd stop-start-restart.
Moreover blinkd man.
Tags: bash, gmail, script, Tips & Tricks
















