Ubuntu – How to run an action when clicking on an appindicator

application-developmentindicatorpython

I'm looking at writing a simple app indicator and I need it to update it's information whenever it's clicked on to open the menu. Is there any kind of on_click action thing?

Let me rephrase it then: How to perform an action (any action) when the user clicks on the appindicator to open its menu?

Best Answer

An app indicator can only open its menu. It can't perform any other action and your program doesn't get notified when the menu is displayed.

You could either include some kind of "Update" menu item or find other events that trigger the update.