| Crates.io | tray |
| lib.rs | tray |
| version | 0.1.2 |
| created_at | 2025-11-30 02:37:06.903514+00 |
| updated_at | 2025-12-02 03:51:27.229073+00 |
| description | Cross-platform tray icon library, with egui and iced support |
| homepage | https://github.com/nobane/tray-rs |
| repository | https://github.com/nobane/tray-rs |
| max_upload_size | |
| id | 1957765 |
| size | 230,832 |
Cross-platform system tray icon library for Rust.
TrayIcon is Send + Sync for use with async runtimescargo add tray
use tray::{Icon, TrayIconBuilder, TrayIconEvent, MouseButton};
let icon = Icon::from_rgba(rgba_data, 32, 32)?;
let tray = TrayIconBuilder::new()
.with_icon(icon)
.with_tooltip("My App")
.build()?;
// Poll for events
let receiver = TrayIconEvent::receiver();
loop {
if let Ok(event) = receiver.try_recv() {
match event {
TrayIconEvent::Click { button: MouseButton::Right, position, .. } => {
// Show your own menu/popup at `position`
}
_ => {}
}
}
std::thread::sleep(std::time::Duration::from_millis(100));
}
| Feature | Description |
|---|---|
serde |
Serialize/deserialize events and IDs |
Shell_NotifyIconW. Handles taskbar restart automatically.NSStatusItem. Requires main thread (MainThreadMarker).MIT