Handle different StatusNotifierItem format
This commit is contained in:
parent
8b2a9c6359
commit
414cbeba0f
1 changed files with 5 additions and 3 deletions
|
|
@ -76,9 +76,11 @@ glib::wrapper! {
|
|||
|
||||
impl StatusMenu {
|
||||
pub async fn new(name: &str) -> zbus::Result<Self> {
|
||||
let idx = name.find('/').unwrap();
|
||||
let dest = &name[..idx];
|
||||
let path = &name[idx..];
|
||||
let (dest, path) = if let Some(idx) = name.find('/') {
|
||||
(&name[..idx], &name[idx..])
|
||||
} else {
|
||||
(name, "/StatusNotifierItem")
|
||||
};
|
||||
|
||||
let connection = zbus::Connection::session().await?;
|
||||
let item = StatusNotifierItemProxy::builder(&connection)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue