Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Openbox3: Gmail Checker Built into the Menu
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Tue Aug 31, 2004 1:33 am    Post subject: Openbox3: Gmail Checker Built into the Menu Reply with quote

Me and syscrash2k have developed a menu entry that shows how many new mails you have in your Gmail account. Clicking on the entry opens up Gmail in your favorite web browser.

Screenshots:
Script in action!

Downloads:
gmail-openbox-0.0.3.1.py

ChangeLog:
0.0.3.1
This release autologs you into Gmail when you click the menu item. It was requested a while back and it's a neat feature. Enjoy!

0.0.3
This version caches login data so it only has to log in once, which allows the menu to be created MUCH faster. Thanks for follower for the majority of the code in this version. For this version and above you need to CVS version of libgmail.py from http://cvs.sourceforge.net/viewcvs.py/libgmail/libgmail/libgmail.py and the files in the normal libgmail release in addition to it.
Also make sure you delete the cache when changing the username/password.

0.0.2
This version shows message subjects in a submenu. Note it makes them read after opening the menu. You should stick with version 0.0.1 if you have a lot of messages in your inbox because it'll download them all which may take time. Also note, if you have a threaded topic in the inbox with a new message in the thread it's going to print all reply topics too.

0.0.1
Initial release.
FIXED: Fixed the int to str error.

NOTES:
Login failed can occur if you log in too much, simple log out of gmail, enter the security password and you're good to go. Comments appreciated.

You need to download libgmail and put it in the same folder as the script also. You can get it from http://libgmail.sf.net/

Don't forget to edit the script and hange your user/pass/browser config.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]


Last edited by GaMMa on Fri Sep 24, 2004 5:45 am; edited 18 times in total
Back to top
View user's profile Send private message
TheChuckster
Tux's lil' helper
Tux's lil' helper


Joined: 18 Aug 2003
Posts: 91
Location: United States

PostPosted: Tue Aug 31, 2004 1:54 am    Post subject: Reply with quote

Sounds really cool, nice work! Any interest in doing a possible Fluxbox port?
_________________
http://thechuckster.homelinux.com/
Back to top
View user's profile Send private message
rush_ad
l33t
l33t


Joined: 22 Jul 2004
Posts: 863
Location: New Jersey, USA

PostPosted: Tue Aug 31, 2004 2:42 am    Post subject: Reply with quote

nice, thanks, anyway to make gmail work with opera?
Back to top
View user's profile Send private message
rezza
Guru
Guru


Joined: 09 Apr 2003
Posts: 434
Location: Edinburgh, UK

PostPosted: Tue Aug 31, 2004 6:36 am    Post subject: Reply with quote

Sounds excellent, GaMMa... I'm gonna have to get OB3 sorted out properly and give this a shot.
_________________
screenshots
blog


Last edited by rezza on Tue Aug 31, 2004 12:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Tue Aug 31, 2004 8:44 am    Post subject: Reply with quote

looking forward to it :) just started using ob
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Tue Aug 31, 2004 2:05 pm    Post subject: Reply with quote

This looks great!
Back to top
View user's profile Send private message
aslocum
Apprentice
Apprentice


Joined: 28 May 2004
Posts: 217
Location: Germany, Frankfurt

PostPosted: Tue Aug 31, 2004 5:45 pm    Post subject: Reply with quote

if you want beta testers...

<<--- :)
_________________
Dell Latitude d610 1.6Ghz 1GB
gcc-4.0.3 2.6.15-no3
Reiser4
Back to top
View user's profile Send private message
syscrash
Guru
Guru


Joined: 14 Apr 2003
Posts: 541

PostPosted: Tue Aug 31, 2004 7:08 pm    Post subject: Reply with quote

Hey all,
We've released it now, here's the link:
http://syscrash2k.hopto.org/stuff/openbox-pipe-gmail/gmail-openbox.py

You'll need to get libgmail from
http://libgmail.sf.net
and put it in the same folder as this. Usage instructions are in the script, you will have to edit it (for your username, password, and browser).
_________________
Play ET? Come by #gentoo.et on freenode!
http://syscrash.ca
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Tue Aug 31, 2004 7:18 pm    Post subject: Reply with quote

There won't be a fluxbox port (done by us), I don't think fluxbox even supports features like this, although I never used it enough to find out. If someone wants to develope a port, feel free to send me a private message/email.

In reguards to the opera issue, all we can do is provide a link for you to click to open it in opera. The checker works reguardless of what browser you're using.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
solatis
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 214
Location: University of Twente, The Netherlands

PostPosted: Tue Aug 31, 2004 7:28 pm    Post subject: Reply with quote

GaMMa wrote:
In reguards to the opera issue, all we can do is provide a link for you to click to open it in opera. The checker works reguardless of what browser you're using.


I think he means that GMail doesn't work under Opera...
_________________
Grtz,

Leon Mergen
http://www.solatis.com/
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Tue Aug 31, 2004 8:45 pm    Post subject: Reply with quote

Oh, well I can't fix that then. :P
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
aslocum
Apprentice
Apprentice


Joined: 28 May 2004
Posts: 217
Location: Germany, Frankfurt

PostPosted: Wed Sep 01, 2004 4:28 pm    Post subject: Reply with quote

just a little question...

i tried to move gmail to a submenu like this:

this is on top of the menu.xml
Code:

<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/                 file:///usr/share/openbox/menu.xsd">
  <menu id="gmail" label="gmail" execute="~/.config/openbox/gmail-openbox.py"/>
  <menu id="games-menu" label="games">
    <item label="neverwinter nights">
      <action name="Execute">
        <execute>nwn</execute>
      </action>
    </item>
...


here comes the submenu:

Code:
 <menu xmlns="http://openbox.org/" id="net-menu" label="net">
    <item label="gftp">
      <action name="Execute">
        <execute>gftp</execute>
      </action>
    </item>
    <item xmlns="http://openbox.org/" label="xchat2">
      <action name="Execute">
        <execute>xchat-2</execute>
      </action>
    </item>
    <item xmlns="http://openbox.org/" label="azureus">
      <action name="Execute">
        <execute>azureus</execute>
      </action>
    </item>
    <item xmlns="http://openbox.org/" label="amule">
      <action name="Execute">
        <execute>amule</execute>
      </action>
    </item>
    <item label="gaim">
      <action name="Execute">
        <execute>gaim</execute>
      </action>
    </item>
    <separator xmlns="http://openbox.org/"/>
    <menu xmlns="http://openbox.org/" id="gmail"/>
  </menu>


but that doesnt work... when i point at the gmail menu it stops a little time to check gmail (as normal) but then comes nothing... no message about new mail or no mail.

when i had the gmail in my root menu it works fine.. but im too dumb so that i touch it too often with my mouse and the little stop is annoying me ;)

any help? thx !
_________________
Dell Latitude d610 1.6Ghz 1GB
gcc-4.0.3 2.6.15-no3
Reiser4
Back to top
View user's profile Send private message
aslocum
Apprentice
Apprentice


Joined: 28 May 2004
Posts: 217
Location: Germany, Frankfurt

PostPosted: Wed Sep 01, 2004 4:49 pm    Post subject: Reply with quote

strange.. after an ob restart it worked fine... nothing changed... and yes: i have reload the config ;)
_________________
Dell Latitude d610 1.6Ghz 1GB
gcc-4.0.3 2.6.15-no3
Reiser4
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Wed Sep 01, 2004 5:20 pm    Post subject: Reply with quote

Yea pipemenus sometimes require restarts (or reloads) after normal (nonpipe) menu changes wierdness.

As for updates...

The login delay thing most likely won't be getting fixed. I tried making another similar script to fetch mail without logging in, but Gmail just yelled at me. I guess when the script closes the gmail session logs out. The only way to get rid of this problem is the creation of a daemon, and I'm not a fan of that method. So we'll have to see, I may be able to fix it. More updates coming soon, hopefully people will like the changes ;).
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Wed Sep 01, 2004 6:32 pm    Post subject: Reply with quote

works great! I can wait 2 seconds. :)
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Wed Sep 01, 2004 8:51 pm    Post subject: Reply with quote

oops spoke too soon:
Code:
WARNING:root:Live Javascript and constants file versions differ.
Traceback (most recent call last):
  File "/home/allucid/.config/openbox/scripts/gmail-openbox.py", line 45, in ?
    print "  <item label=\"" + new_messages + " new messages.\">"
TypeError: cannot concatenate 'str' and 'int' objects
Entity: line 3: parser error : Premature end of data in tag openbox_pipe_menu line 2

^

(openbox:9987): Openbox-WARNING **: Invalid output from pipe-menu: /home/allucid/.config/openbox/scripts/gmail-openbox.py


[edit] i don't do python but after a quick google i figured out how convert an int to a string. to fix the error change new_messages on line 45 to `new_messages`.

When you click on it and it opens a web browser (firefox in my case) is it possible to make it log in for you automagically?
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu Sep 02, 2004 12:10 am    Post subject: Reply with quote

I released 0.0.2, ChangeLog and info at the top. Also I fixed version 0.0.1. I don't want to take the first release down because people with large inboxes may have to wait a while to fetch messages or others may not like it because it's too complex :P.

I just have Gmail remember my login, I'll look into adding an autologin next release. It shold be possible, I just have to pass the right lines. Bug reports appreciated :P.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minnetonka, Minnesota

PostPosted: Thu Sep 02, 2004 12:49 am    Post subject: Reply with quote

what is gmail?
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Thu Sep 02, 2004 1:27 am    Post subject: Reply with quote

zecora wrote:
what is gmail?

living under a rock? just kidding => gmail.google.com
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minnetonka, Minnesota

PostPosted: Thu Sep 02, 2004 1:30 am    Post subject: Reply with quote

allucid wrote:
zecora wrote:
what is gmail?

living under a rock? just kidding => gmail.google.com


ok, man do i feel dumb.


can i get gmail?
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu Sep 02, 2004 1:45 am    Post subject: Reply with quote

Not turning this into an invite thread, but send me a PRIVATE MESSAGE with your name and email and I'll invite you. I've got 12 invites @_@.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Thu Sep 02, 2004 1:46 am    Post subject: Reply with quote

zecora wrote:
can i get gmail?

try here.

GaMMa wrote:
0.0.1
Initial release.
FIXED: Fixed the int to str error.


I don't think so...
Code:
else:
   print "  <item label=\"" + new_messages + " new messages.\">"

should be
Code:
else:
   print "  <item label=\"" + `new_messages` + " new messages.\">"


I think that getUnreadMsgCount() returns an int. I looked at the library and it was all greek to me so I could be wrong. :)

[Edit] I tried the new version also (looked cool) but unfortunately it blew up in my face because the messages in my inbox were very long nested replies (mailing lists). Heh, I should stick with the first version. Cool idea, though. I would have never thought of doing this in the menu. 8)


Last edited by allucid on Thu Sep 02, 2004 1:52 am; edited 2 times in total
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu Sep 02, 2004 1:49 am    Post subject: Reply with quote

Whoops uploaded the unfixed one! There we go.. I needed to change it to str(new_messages) :P.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2137
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Sep 05, 2004 11:44 am    Post subject: Reply with quote

I know this is a stoopid question, but where do I put libgmail.py?
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
aslocum
Apprentice
Apprentice


Joined: 28 May 2004
Posts: 217
Location: Germany, Frankfurt

PostPosted: Sun Sep 05, 2004 11:52 am    Post subject: Reply with quote

in the folder where you have the script
_________________
Dell Latitude d610 1.6Ghz 1GB
gcc-4.0.3 2.6.15-no3
Reiser4
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum