#!/usr/bin/perl #############--------------------------Gmail Checker v.2.0---------------------------############## #PekWM pipe menu programmed in perl to see how many new messages there are. #NEW TO V.2.0 #Get Messages names #$Count is defaultly 0 so it could never output: #You have new messages ######INSTALLATION########### #1.Firstly copy this to your scripts directory : /usr/share/pekwm/scripts/ #2.chmod this file +x #3.Then where in this script it says yourusernamehere and yourpasswordhere #Fill in accordingly #.Finally do the following in shell: #su #cpan #install #Mail::Webmail::Gmail #exit #Finally Enter the script in your pekwm menu config like so: #SubMenu = "Gmail" { # Entry = { Actions = "Dynamic /usr/share/pekwm/scripts/gmail" } #} #Made by Bladdo - Bladdo.net - bladdo@bladdo.net(previously Milo - Milo.Psunit.com - TinyTux@gmail.com) #Feel free to edit any way you like ############------------------------End Instructions--------------------######################## use Mail::Webmail::Gmail; #Your username $user = "yourusernamehere"; #Your password $pass = "yourpasshere"; #Your browser my $browser = "firefox"; my $count = 0; my $temp; my $gmail = Mail::Webmail::Gmail->new( username => $user, password => $pass, ); my @subjects; $m = $gmail->get_messages(); foreach ( @{ $m } ) { if ( $_->{ 'new' } ) { $count++; $_->{'subject'} =~ s/<(.|\n)+?\>//g; push @subjects, $_->{'subject'}; } } $googlelogin = "http://www.gmail.com"; print "Dynamic {\n"; print "Entry = \"You have $count new messages\" { Actions = \"Exec $browser $googlelogin\" }\n"; print "Submenu = \"Messages\" {\n"; foreach $temp (@subjects) { print "Entry = \"$temp\" { Actions = \"Exec $browser $googlelogin \" }\n"; } print "}\n"; print "}\n";