trayicon

Crates.iotrayicon
lib.rstrayicon
version0.4.0
created_at2020-07-11 21:27:45.017859+00
updated_at2026-01-19 11:57:46.83553+00
descriptionTray Icon, that thing in the corner
homepagehttps://github.com/ciantic/trayicon-rs/
repositoryhttps://github.com/ciantic/trayicon-rs/
max_upload_size
id264195
size208,878
Jari Pennanen (Ciantic)

documentation

README

TrayIcon

Currently I target KDE/Windows tray icon implementation, with popup menu, click, double click events. I don't use MacOS, but I try to cargo check that it still compiles. Library has ability to plug in winit event loop easily as well as other event loop structures.

Open here a full working example with winit crate 🢅

Alternatives

Most mature alternative is qdot's systray-rs. Unfortunately I got frustrated with the API in it and decided to rewrite my own. This however largely does not use the code in it, instead I loaned my old C/C++ code repository as a template.

KDE only KSNI

Development

rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-apple-darwin
rustup target add x86_64-pc-windows-msvc

Then you can check the code compiles for all targets with:

cargo check --target x86_64-apple-darwin
cargo check --target x86_64-pc-windows-msvc
cargo check --target x86_64-unknown-linux-gnu

Change log

  • 0.4.0 - 2026-01-12

    • KDE Support
    • Backwards incompatible change: Event type must be also Send + Sync
    • On Windows right click defaults now to showing the context menu if no handler is set, like in KDE and MacOS.
  • 0.3.0 - 2025-07-18

  • 0.2.0 - 2024-05-09

    • Removed dependency to winit crate, now setting a sender is a function.
    • Added show_menu, this means user must call it to show the menu even on right click. Previously right click always showed the menu.

TODO

  • Provide coordinates of the Tray Icon area for custom popups.
  • Drop winapi library and use windows crate instead, or directly bind to C functions (this was previous behavior).
Commit count: 103

cargo fmt