Skip to content

[feat] Use ksni crate for tray icons on Linux #11293

@dfaust

Description

@dfaust

Describe the problem

Currently Tauri uses libappindicator to create tray icons on Linux. But it has far fewer features than the xdg standard, as well as macOS and Windows.
There are multiple bug reports and feature requests regarding tray icon issues on Linux.
In particular it's not possible to handle left clicks and to add tool tips.

Describe the solution you'd like

I would like to use the xdg standard for tray icons, which is supported on all Linux desktop environments and has many more features than libappindicator. Also libappindicator looks pretty dead. The last commit to the src folder is 15 years old.
https://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk/files

It looks to me like https://github.com/iovxw/ksni is a great fit for this task. It should be fairly easy to integrate it into Tauri.

I'm ready to write the necessary code myself. I just want to know if you are interested in merging it and if you would like to keep libappindicator as a choice, or if I can remove it.

Alternatives considered

No response

Additional context

No response

Activity

FabianLars

FabianLars commented on Oct 10, 2024

@FabianLars
Member

Yes, this is desirable, see tauri-apps/tray-icon#107 and tauri-apps/tray-icon#104 for example.

It should be fairly easy to integrate it into Tauri.

Probably yeah, the only thing i'm not sure how to best approach is the inter-op with muda.

dfaust

dfaust commented on Oct 10, 2024

@dfaust
Author

Ok, great. Sounds like you would like to remove libappindicator as well. I'll start working on it then.

dfaust

dfaust commented on Oct 20, 2024

@dfaust
Author

@FabianLars: Integrating it with muda really is a pain. After a few iterations of shoehorning it in, I came up with the following changes. Please have a look at them. If you don't have any major concerns, I will update the docs and create the merge requests.

tauri-apps/tray-icon@dev...dfaust:tray-icon:ksni

tauri-apps/muda@dev...dfaust:muda:ksni

FabianLars

FabianLars commented on Oct 20, 2024

@FabianLars
Member

Let me pull in @amrbashir the maintainer of the crates in question. I'll still try to take a look myself but i'm still out sick so idk when i can get to it.

amrbashir

amrbashir commented on Oct 29, 2024

@amrbashir
Member

@dfaust thank you for the hard work, this looks very promising, please feel free to open the PRs and we will discuss the finer details

Weathercold

Weathercold commented on Jul 16, 2025

@Weathercold

I have no problem with migrating to ksni, but have you considered libayatana-appindicator, which is supposed to be a GTK-free continuation of libappindicator? https://github.com/AyatanaIndicators/libayatana-appindicator-glib

FabianLars

FabianLars commented on Jul 16, 2025

@FabianLars
Member

we're using the "old" version that still relied on gtk in conjunction with libappindicator because both libayatana-appindicator and libappindicator aren't available on all distros (together they are covering all though).

the new -glib version would be interesting since it should work together with gtk4 but it's not available in any distro yet (except debian unstable) as far as i can tell and it also has the same feature set so stuff like onclick events are still missing. Since the ksni PR(s) are already in a pretty good state i don't think it's worth to look into this new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @dfaust@FabianLars@amrbashir@Weathercold

    Issue actions

      [feat] Use ksni crate for tray icons on Linux · Issue #11293 · tauri-apps/tauri