AyatanaIndicators / libayatana-appindicator

Ayatana Application Indicators Shared Library
GNU Lesser General Public License v3.0
56 stars 13 forks source link

Introduce back python bindings (for python 3) #58

Closed maxerbox closed 2 years ago

maxerbox commented 2 years ago

Hello,

It seems that python bindings are not provided anymore. Libappindicator is deprecated and a lot of tools written in python still rely on tray icons.

Could you please provide python bindings with a few examples ?

mathiascode commented 2 years ago

Python 2 bindings were removed, but Python 3 works fine: https://lazka.github.io/pgi-docs/#AyatanaAppIndicator3-0.1/classes/Indicator.html

As for examples, the API is the same as AyatanaAppIndicator3. You can do something similar to this to support both: https://github.com/nicotine-plus/nicotine-plus/blob/1ef25abbcca8e18a2f1f624f777896e4d59f689f/pynicotine/gtkgui/widgets/trayicon.py#L273-L287

WhyNotHugo commented 2 years ago

@mathiascode Thanks for the reference. Here is simple example of switching from AppIndicator3 to supporting both libraries:

https://codeberg.org/WhyNotHugo/caffeine-ng/commit/d13b2b97160649b465213e691a8df2e958ecf739

maxerbox commented 2 years ago

Thanks you mathias, I was looking for the binding generation in this repository, hence the confusion.