Gmail Script

Hi!, somebody know how I can make a fvwm script to check the gmail acount?
thxs :slight_smile:

Heres a link on the gentoo forums on how to do it.

Heh, I have some Python code lying around that gets the number of new messages, just haven’t gotten around to writing the FvwmScript to display it (I’m rethinking my setup atm), should be dead easy though…

[code]#!/usr/bin/env python
import libgmail
import sys

if name == “main”:
ga = libgmail.GmailAccount(sys.argv[1] + “”, sys.argv[2])
print ga.getUnreadMsgCount()[/code]

It expects two arguments: the username and the password, might kick together the FvwmScript part later today or somewhere tomorrow…

So that still was today…

WindowTitle {FvwmGmail}
WindowSize 120 25

Set $MainColorset=(GetScriptArgument 1)
If $MainColorset <> {} Then
ChangeColorset 0 $MainColorset
ChangeColorset 1 $MainColorset
Set $Username=(GetScriptArgument 2)
Set $Password=(GetScriptArgument 3)
Set $cmd={exec .fvwm/scripts/FvwmGmail/ } $Username { } $Password}
Echo $cmd
Set $tmp={New mail(s): }(GetOutput $cmd 1 -1)
ChangeTitle 1 $tmp

If (RemainderOfDiv (GetTime) 30)==0 Then
Set $tmp=(GetOutput $cmd 1 -1)
ChangeTitle 1 $tmp

Widget 1
Position 0 0
Size 120 25
Type ItemDraw
Title {}
Case message of


It’s basic as it only displays the number of new messages, wouldn’t be hard to add the total number of messages in your inbox.

thxs for replys:
VoiDeR the post … gmail.html is deprecated (the links)

theBlackDragon I can’t understand ur script, where I set the pass and user? u say that isn’t finished yet?

Thxs to all :slight_smile:

I’ve just edited my post, you basically have two files, the Python script which does the actual work of getting the data from the server and the FvwmScript that displays it, you might have to edit the path to the Python script though as I keep both files in ~/.fvwm/scripts/FvwmGmail if you put them there they shouldn’t need any modification.

The FvwmScript takes three parameters, the first one being a Colorset number to use, the second one being your Gmail username and the third one being your password, you might want to use Piperead to read in the latter ones from external files as keeping that kind of stuff in your config isn’t really secure, and might cause some trouble if you decide to share it and forget to take those ‘details’ out :wink:

But as I said, it doesn’t do any advanced stuff, just displays the number of new messages, which is all I need :slight_smile:

Hi!, well I’ve some problems, let’s see
I’ve modified the script with my user,pass and the path to the python script

Then, I swallowed the script in FvwmButton

When y restart fvwm, I can see the script in FvwmButton and show me “New mail(s):”, but nothing else. So I’ve tryed to run “manually” in a terminal:

exec /home/blue/fvwm-config/scripts/ heremyuser heremypass

After 3 seconds the terminal has closed without errors

NOTE: the 2 files, FvwmGmail and have chmod a+x
And I have emerged libgmail, any ideas?

thxs :slight_smile:

It seems the script doesn’t like it when it’s executed with an absolute path, I strongly suspect this to be a bug in libgmail is it works fine for FvwmMpd. I thought that normally FvwmScript should also find the script without the path being specified if it’s in the same directory as the calling script but that doesn’t seem to work for me which is a real pain…

I’ll try to work something out later today.

Well, reading ur post, I’ve tryed this
copy the files FvwmGmail and to /usr/fvwm/fvwm and edited the FvwmGmail script:

But I get the same result :frowning: