Crates.io | system-tray |
lib.rs | system-tray |
version | 0.3.0 |
source | src |
created_at | 2023-08-13 13:42:54.109917 |
updated_at | 2024-11-08 01:29:38.082794 |
description | Async `StatusNotifierItem` and `DBusMenu` client for custom tray implementations. |
homepage | |
repository | https://github.com/jakestanger/system-tray |
max_upload_size | |
id | 943321 |
size | 70,268 |
An async implementation of the StatusNotifierItem
and DbusMenu
protocols for building system trays.
Requires Tokio.
use system_tray::client::Client;
#[tokio::main]
async fn main() {
let client = Client::new().await.unwrap();
let mut tray_rx = client.subscribe();
let initial_items = client.items();
// do something with initial items...
while let Ok(ev) = tray_rx.recv().await {
println!("{ev:?}"); // do something with event...
}
}