Description
tray-icon is a Rust library for adding tray icons to desktop applications. It lets a Rust app place an icon in the system tray or menu bar, with an optional menu, and receive events when the icon is clicked. The project supports Windows, macOS, Linux and FreeBSD. On Linux and FreeBSD it can use either the AppIndicator backend, which uses GTK 3, or the KSNI backend, which talks to the StatusNotifierItem D-Bus interface and does not need the same system libraries. The README explains platform-specific requirements, such as running an event loop on the main thread on macOS and creating the tray icon there as well. Optional Cargo features add serialization and forward options to the muda menu library, including GTK 3 and GTK 4 support. Installation notes for Arch, Debian and Ubuntu, and the FreeBSD packages needed to compile it, are included. Examples show how to create a tray icon with and without a menu, and how to process tray events. The library is public on GitHub and is part of the Tauri project.…
Highlights
- Tray icons for Windows, macOS, Linux and FreeBSD
- Optional menus through the muda library
- AppIndicator or KSNI backends on Linux and BSD
- Event handling for tray icon clicks
- Examples for icons with and without menus
Ratings & Reviews
No ratings yet
Be the first to rate Tray Icon.
People also visit
Tray Icon FAQ
What is tray-icon?
It is a Rust library that lets desktop applications show an icon in the system tray or menu bar, with an optional menu.
Which platforms are supported?
The README lists Windows, macOS, Linux (AppIndicator or KSNI) and FreeBSD (AppIndicator or KSNI).
Do I need GTK on Linux?
The default Linux backend uses GTK 3 with libappindicator or libayatana-appindicator. The ksni backend does not need these system libraries unless a muda GTK backend is also enabled.
How do I handle clicks on the icon?
The project's README shows how to use TrayIconEvent::receiver to get the events for the icon, and includes examples with and without a menu.
Is it free?
Yes. The source code is public on GitHub, and the project is open source.
What are the best Tray Icon alternatives?
Popular alternatives to Tray Icon include Tray Manager, Syncthing Tray and Traymond. See all Tray Icon alternatives

