getlantern / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
3.28k stars 451 forks source link

Support libayatana-appindicator on Linux #225

Closed Crosse closed 2 years ago

Crosse commented 2 years ago

This changes the default behavior to use the libayatana-appindicator library instead of the older libappindicator. If you need to link to libappindicator, you can use the build tag "legacy_appindicator":

    go build -tags=legacy_appindicator

In order to support both libraries, I basically just moved the C setup and includes into two separate files (systray_linux_appindicator.go and systray_linux_ayatana.go) guarded by the relevant build tags. While here I also cleaned up some stale/unused build tags that referenced Darwin (I'm guessing this was a copy/paste error from a long time ago).

This was inspired by #224, but is a bit simpler in its approach, I think.

Tachi107 commented 2 years ago

🎉️