{"id":16592516,"url":"https://github.com/jakestanger/system-tray","last_synced_at":"2025-08-31T11:36:35.356Z","repository":{"id":230297397,"uuid":"779052062","full_name":"JakeStanger/system-tray","owner":"JakeStanger","description":"Async Rust implementation of the StatusNotifierItem and DbusMenu protocols for building system trays.","archived":false,"fork":false,"pushed_at":"2025-02-08T01:49:49.000Z","size":70,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T01:51:19.531Z","etag":null,"topics":["async","dbusmenu","rust","statusnotifieritem","tokio","tray","zbus"],"latest_commit_sha":null,"homepage":"https://docs.rs/system-tray","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JakeStanger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-28T23:58:57.000Z","updated_at":"2025-02-08T01:49:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"647b86cd-e34f-4926-ac65-d294f18d2143","html_url":"https://github.com/JakeStanger/system-tray","commit_stats":null,"previous_names":["jakestanger/system-tray"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeStanger%2Fsystem-tray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeStanger%2Fsystem-tray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeStanger%2Fsystem-tray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeStanger%2Fsystem-tray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JakeStanger","download_url":"https://codeload.github.com/JakeStanger/system-tray/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238803488,"owners_count":19533328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","dbusmenu","rust","statusnotifieritem","tokio","tray","zbus"],"created_at":"2024-10-11T23:21:11.988Z","updated_at":"2025-02-14T07:32:00.922Z","avatar_url":"https://github.com/JakeStanger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System Tray\n\nAn async implementation of the `StatusNotifierItem` and `DbusMenu` protocols for building system trays.\n\nRequires Tokio.\n\n## Example\n\n```rust\nuse system_tray::client::Client;\n\n#[tokio::main]\nasync fn main() {\n    let client = Client::new().await.unwrap();\n    let mut tray_rx = client.subscribe();\n\n    let initial_items = client.items();\n    \n    // do something with initial items...\n    \n    while let Ok(ev) = tray_rx.recv().await {\n        println!(\"{ev:?}\"); // do something with event...\n    }\n}\n```\n\n### `dbusmenu-gtk3`\n\nAlthough the library provides a built-in Rust-native implementation of the `DBusMenu` protocol,\nthis has a few issues:\n\n- There are some known bugs. For example, opening a file in VLC will break its menu.\n- If you are creating a menu UI, you need to parse the whole tree set up each element, and track all changes manually.\n\nTo circumvent this, bindings to the `dbusmenu-gtk3` system library are included. \nWhen the feature of the same name is enabled, you can listen for `UpdateEvent::MenuConnect`\nand create the GTK element based on that:\n\n```rust\nfn on_update(update: system_tray::Event) {\n    match update {\n        Event::Update(address, UpdateEvent::MenuConnect(menu)) =\u003e {\n            let menu: gtk::auto::Menu = system_tray::gtk_menu::Menu::new(\u0026address, \u0026menu);\n            // do something with the menu element\n        }\n    }\n}\n```\n\n\u003e [!NOTE]\n\u003e This feature is disabled by default to reduce compilation times.\n\n## Attributions\n\nSome of the code in this repository, namely the SNI host, is taken from [eww](https://github.com/elkowar/eww/blob/50ec181fc7ff2a68d6330e8897de2c5179575935/crates/notifier_host/src/host.rs) \nunder [MIT](https://github.com/elkowar/eww/blob/master/LICENSE).\nMany thanks to elkowar. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakestanger%2Fsystem-tray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakestanger%2Fsystem-tray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakestanger%2Fsystem-tray/lists"}