qdbus => dbus-rs #384
Answered
by
mulkieran
LuckyTurtleDev
asked this question in
Q&A
-
I am trying to execute the KDE plasmashell with dbus. I have successfully test the call with qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'for (const d of desktops()) { print(d); print("\n"); for (const key in d) { print(key); print(" = "); print(d[key]); print("\n"); } print("\n\n"); }' let interface = "org.kde.plasmashell";
let path = "/PlasmaShell/org.kde.PlasmaShell";
let method = "evaluateScript";
let args = ("to", "do");
let timeout = Duration::from_millis(5000);
let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(interface, path, timeout); //line 12
let (res,): (Vec<String>,) = proxy.method_call(interface, method, args).unwrap();
I am not sure if I did everything right. |
Beta Was this translation helpful? Give feedback.
Answered by
mulkieran
May 31, 2022
Replies: 1 comment 9 replies
-
Try these lines instead of what you have:
and since that worked w/ qdbus, it should work for your Rust program, in the sense that now the method will be called, and your program won't fail with an invalid object path. You still have to tackle passing the arguments, though. |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
LuckyTurtleDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try these lines instead of what you have:
and since that worked w/ qdbus, it should work for your Rust program, in the sense that now the method will be called, and your program won't fail with an invalid object path. You still have to tackle passing the arguments, though.