Hamster time tracker in system tray

Linux
#arch#bitbucket#hamster#linkedin#linux#python#time-tracker#ubuntu

Project Hamster is probably the best Linux time tracker out there. But there is a small problem. It is written to be used as Gnome panel applet. I guess that some things will change with Gnome 3 (maybe it will get better Gnome shell integration or something?) but the lead developer has written that there will be no tray icon for Hamster:

generally though the system or notification tray is the no-go zone and one that triggered all the shunning in the panels (too many icons behaving too differently etc).

I found that there is script to use it with Ubuntu's indicator applet but could not find one for system tray. So I did it myself.

I modified hamster-appindicator script by Alberto Milone to work with system tray (instead of appindicator). It now behaves similar to the panel applet. Only noticeable difference is that you don't see current running task name and time in the tray (because there is only an icon and no text) and how long it has been running, but you can see it in the tooltip of the tray icon.

To make it more usable, I have included green and red icons that are used to indicate running task (by default I made it use green icon but you can change it in the script). Left mouse click toggles tracker window, right click shows menu.

Icons and script can be downloaded from https://bitbucket.org/janhouse/hamster-tray/downloads .

Copy icons to /usr/share/icons/ or ~/.icons/ Install latest Hamster (I tested it with latest git version): http://projecthamster.wordpress.com/building-and-running/ Get latest hamster-tray version from https://bitbucket.org/janhouse/hamster-tray/downloads make it executable and run it

I'l later make hamster-tray PKGBUILD for Archlinux and put it on AUR. If you want to point out any errors (it probably has some since I was making it in rush in the middle of the night) leave a comment. I'l try to update it at some point. P.S. YAY! I can use Hamster again! :)

UPDATE:

08.04.2011.

After upgrading my Archlinux today I noticed that it did not work anymore because upgrade contained Gnome3 stuff. So the error was:

$ hamster-tray
Traceback (most recent call last):
  File "/usr/local/bin/hamster-tray", line 51, in <module>
    from hamster.applet import HamsterApplet
  File "/usr/lib/python2.7/site-packages/hamster/applet.py", line 29, in <module>
    import gnomeapplet
ImportError: libpanel-applet-2.so.0: cannot open shared object file: No such file or directory

Quick dirty fix for the moment is to edit applet.py and remove line:

import gnomeapplet

This will probably make it not work as Gnome 2 panel applet but I guess that those applets are removed from Gnome3 anyway. This is just a temporary fix and I will try to completely rewrite this script as soon as I get some time.