6

AppIndicator allowed your app to create menus in GNOME, like this:

enter image description here

Specifically, with python-appindicator, you could do it in Python. However, it looks like python-appindicator is gone in the latest Linux distributions, including Ubuntu 20.04.

Is there a replacement for it? I couldn't find much.

BTW I wish the the same library worked with different desktops, like KDE and GNOME, but AppIndicator was GNOME-only, I believe.

MWB
  • 724

2 Answers2

7

I think python-appindicator package is deprecated and GObject bindings are recommended. There are GObject bindings for appindicators and they should be used AFAIK.

There are two packages in ubuntu for python bindings for appindicator. One is based on libappindicator and another is based on libayatana-appindicator I donot know the core difference between the two but my guess is ayatana-appindicator is latest ones for clarity of names and are also available in other distros.

The package names are:

  • gir1.2-appindicator
  • gir1.2-appindicator3.
  • gir1.2-ayatanaappindicator
  • gir1.2-ayatanaappindicator3.

The 3 suffix one are for gtk3 and can be used for gtk3 related apps.

Here is my own use case which shows my native calendar in panel. Shown below is usage in gnome-shell with kappindicator extension along with dropbox.

Using gnome-shell Kappindicator extension along with dropbox which also uses appindicator

Basically, for documentation see https://lazka.github.io/pgi-docs/AyatanaAppIndicator3-0.1/index.html

P.S. The image is from fedora as I am currently in fedora desktop with gnome-shell 3.38. I think ubuntu ships with https://packages.ubuntu.com/focal/gnome-shell-extension-appindicator which can be used to show status tray and appindicators for already existing ones. I currently use it for zoom, dropbox etc

sagarchalise
  • 23,988
  • Are the two packages souce-compatible with python-appindicator, or does your app need drastic changes to the code to use them instead of python-appindicator? – MWB Nov 05 '20 at 05:16
  • 1
    You will require some tweaks to your codebase as far as I can tell. There are some information on this https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Python_version . I think pygtk one is using python-appindicator. Also, https://askubuntu.com/questions/108035/writing-indicators-with-python-gir-and-gtk3 talks about writing indicators. But I have used gi.repository only so not sure how much change it will bring. As far as two package go, they seem to be compatible and have same API just the name differ AFAIK – sagarchalise Nov 05 '20 at 05:34
  • @sagarchalise

    Your comment helped me. Thanks!

    – Rony Mesquita Feb 05 '23 at 04:36
0

There is a GObject introspection version of libappindicator in Ubuntu 20.04 LTS repository. You have to find examples of its usage.

You have to try developing stuff on top of libayatana-appindicator packages with python/gir bindings.

Also there is a MATE desktop environment which has support of many traditional indicators and appindicators on MATE Panel.

N0rbert
  • 99,918
  • libayatana-appindicator seems to be 11+ years old, but it has only 4 stars on github. 0 examples in Python. It looks like abandonware at first glance... – MWB Sep 08 '20 at 20:27
  • 2
    Sounds really strange, last commit was on 23 Jul. It is absolutely alive. – N0rbert Sep 08 '20 at 20:29
  • 1
    @MWB: you were likely browsing an outdated mirror/fork. The official repository is really active, specially now since the original libappindicator from Ubuntu is deprecated. As for Python examples, gir1.2-ayatanaappindicator3 is source-compatible with gir1.2-appindicator3, you just have to change the from gi.repository import ... line – MestreLion Jun 16 '23 at 20:37