Appindicator for Hamster part 2

This week I’m supposed to be on holiday but I decided to spend some time on my appindicator for Hamster. To be honest, though, a merge request on github from Izidor Matušov, together with our discussion in the merge review thread, was what made me want to focus on hamster again. He provided a light monochrome icon, based on the original icon, (to use with the Ambiance theme) and some code to switch icons when the indicator requires attention. I worked more on the light icon and made a dark variant for the Radiance theme, so that we finally have monochromatic icons for hamster. Although icon design is definitely not my field, I’m quite happy with the results (help is always welcome though).

The main problem I wanted to solve was to allow users to see when hamster has an active task, without having to click on the indicator. I implemented two solutions but I enabled only one by default:

  • I added a slight blue glow (which you can disable) to the icon so that you can see when there is an active task in hamster.

  • I made it possible to have a text label (disabled by default) with the current activity beside the icon. This is quite similar to how the old gnome applet used to work. You can also set the maximum length of this label (the default is 20 characters).

Finally, as promised, I packaged the indicator and set up a PPA with packages for both Natty and Oneiric.

Note: in Oneiric you’ll also have to install my patched hamster-applet, otherwise hamster-applet will crash looking for gnomeapplet (which we no longer ship).

If you want to configure the indicator you can either open gconf-editor and look for /apps/hamster-indicator/ or follow these steps from the command line:

To enable/disable the icon glow:

$ gconftool-2 --set "/apps/hamster-indicator/icon_glow" --type bool "false"
$ gconftool-2 --set "/apps/hamster-indicator/icon_glow" --type bool "true"

To enable/disable the activity label:

$ gconftool-2 --set "/apps/hamster-indicator/show_label" --type bool "true"
$ gconftool-2 --set "/apps/hamster-indicator/show_label" --type bool "false"

To set the maximum label length:

$ gconftool-2 --set "/apps/hamster-indicator/label_length" --type int "20"

EDIT: you can launch the indicator with the following command:

$ hamster-indicator

17 thoughts on “Appindicator for Hamster part 2

  1. You, sir, rock.

    Thanks for working on this. However, shouldn’t we be able to apply your patch to hamster-applet to Oneiric, if we no longer ship gnomeapplet? I haven’t checked the inplications of this, but it makes sense to fix things that are broken. 🙂

    1. Yes, of course I plan on including my patch in Ubuntu. I only need to talk to whoever maintains hamster-applet in Ubuntu (to see if they are ok with my change) when I’m back from holidays. For now I simply put my workaround in the PPA for testing.

  2. Thanks for this great work. Hamster is indispensable to me, so having indicator support, especially now that we can’t use a legacy panel, is important. I looked at your patch for not failing on import of gnomeapplet, expanded on it and uploaded to Oneiric. I’m using your hamster-indicator now and everything seems to be working

  3. Great work Alberto. Thank you. Hamster is great tool. It is nice to see it using appindicator. 🙂

    Let’s hope that it can land in Oneiric without adding your ppa, so that it’s working again for all users without ppa.

  4. I’ve been using this for quite a while and am quite pleased with it. There is one bit that is a little odd, if I enable the text label, then the interface is sort of odd. Eg, with the label showing if I click on the indicator I have something that looks like:

    My task 00:05
    My task 00:05
    Stop tracking

    Add earlier activity
    Show overview



    The problem is the first two identical lines. It would be better if the 2nd said something like ‘Update activity’. Also (and this affects both with and without showing the label) I find it odd that I have to click the current activity to change to another one…. Both of these are related, but I’m not sure the best way to fix it.

    1. Good point. I’m trying to reuse the localised strings from hamster though (so that I don’t have to deal with localisation myself). Would “Switch” be acceptable instead of “Update activity”?

      Furthermore, if you don’t show the label beside the icon and then you replace the task name with something else (say “Switch”) you won’t have a quick way to see what task you’re keeping track of and how long you’ve been doing it.

  5. When i tried to run hamster-indicator on Xubuntu 11.10 this morning i received the following error:

    $ hamster-indicator
    Traceback (most recent call last):
    File “/usr/bin/hamster-indicator”, line 25, in
    import appindicator
    ImportError: No module named appindicator

    Even after installing the new version from you PPA I still had this error. Turns out I had to install python-appindicator.
    Maybe this can be added as a dependency for the hamster-indicator package?

  6. Hey,

    Thanks for building this! Just wondering how I have to ‘force’ the hamster-applet patch that you created. I installed it but it’s not appearing on Gnome3 like I would have expected :/

  7. Actually I did manage to get this working I think but now I’m getting the following error:

    WARNING:root:Could not import gnomeapplet. Defaulting to upper panel
    /usr/bin/hamster-indicator:222: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)’ failed
    self.activity_label.set_markup(“”) #clear – seems to fix the warning

  8. Hi Alberto,

    I just switched from Maverick to Oneiric and I was glad to find that Hamster with your indicator working just like in Gnome 🙂 Thanks!

    Now the left/righ click of the mouse both calls the menu of the indicator. Would it be possible to start the “change activity window” for the left click while still have the menu opened for the right click?

Leave a Reply

Your email address will not be published. Required fields are marked *