system_tray/
lib.rs

1/// # System Tray
2///
3/// An async implementation of the `StatusNotifierItem` and `DbusMenu` protocols for building system trays.
4///
5/// Requires Tokio.
6///
7/// ## Example
8///
9/// ```no_run
10/// use system_tray::client::Client;
11///
12/// #[tokio::main]
13/// async fn main() {
14///     let client = Client::new().await.unwrap();
15///     let mut tray_rx = client.subscribe();
16///
17///     let initial_items = client.items();
18///
19///     // do something with initial items...
20///
21///     while let Ok(ev) = tray_rx.recv().await {
22///         println!("{ev:?}"); // do something with event...
23///     }
24/// }
25/// ```
26mod dbus;
27
28pub mod data;
29
30/// Client for listening to item and menu events,
31/// and associated types.
32pub mod client;
33
34/// Error and result types.
35pub mod error;
36
37/// `StatusNotifierItem` item representation.
38pub mod item;
39
40/// `DBusMenu` menu representation.
41pub mod menu;
42
43#[cfg(feature = "dbusmenu-gtk3")]
44pub mod gtk_menu;
45
46pub(crate) mod names {
47    pub const WATCHER_BUS: &str = "org.kde.StatusNotifierWatcher";
48    pub const WATCHER_OBJECT: &str = "/StatusNotifierWatcher";
49
50    pub const ITEM_OBJECT: &str = "/StatusNotifierItem";
51}