Hi!, somebody know how I can make a fvwm script to check the gmail acount?
thxs
Heres a link on the gentoo forums on how to do it.
http://forums.gentoo.org/viewtopic-t-242076-highlight-fvwm+gmail.html
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] + ā@gmail.comā, sys.argv[2])
ga.login()
print ga.getUnreadMsgCount()[/code]
It expects two arguments: the username and the password, might kick together the FvwmScript part later today or somewhere tomorrowā¦
[EDIT]
So that still was todayā¦
[code]#--fvwm--
WindowTitle {FvwmGmail}
WindowSize 120 25
Init
Begin
Set $MainColorset=(GetScriptArgument 1)
If $MainColorset <> {} Then
Begin
ChangeColorset 0 $MainColorset
ChangeColorset 1 $MainColorset
End
Set $Username=(GetScriptArgument 2)
Set $Password=(GetScriptArgument 3)
Set $cmd={exec .fvwm/scripts/FvwmGmail/NewMessages.py } $Username { } $Password}
Echo $cmd
Set $tmp={New mail(s): }(GetOutput $cmd 1 -1)
ChangeTitle 1 $tmp
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 30)==0 Then
Begin
Set $tmp=(GetOutput $cmd 1 -1)
ChangeTitle 1 $tmp
End
End
Widget 1
Property
Position 0 0
Size 120 25
Type ItemDraw
Title {}
Main
Case message of
SingleClic:
Begin
End
End
[/code]
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 forums.gentoo.org/viewtopic-t-24 ā¦ 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
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
But as I said, it doesnāt do any advanced stuff, just displays the number of new messages, which is all I need
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/NewMessages.py heremyuser heremypass
After 3 seconds the terminal has closed without errors
NOTE: the 2 files, FvwmGmail and NewMessages.py have chmod a+x
And I have emerged libgmail, any ideas?
thxs
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 Newmessage.py to /usr/fvwm/fvwm and edited the FvwmGmail script:
But I get the same result