-
Hello! I'm trying to get a screenshot through the I'm using rust with zbus to implement all this and here is my code: {
let conn = Connection::session()?;
let screenshot = ScreenshotProxyBlocking::new(&conn).unwrap();
let options = HashMap::from([
("interactive", Value::Bool(false)),
("handle_token", Value::Str(Str::from(crate_name!()))),
]);
let path = screenshot.screenshot("", options)?;
let dest = Signature::try_from("as").unwrap();
// since `org.freedesktop.portal.Request` is a signal
conn.emit_signal(
Some("org.freedesktop.portal.Desktop"),
path,
"org.freedesktop.portal.Request",
"Response",
&dest,
)
.unwrap();
println!("here: '{}'", dest);
panic!("Did it work?");
} I'm a bit out of clue here what I'm supposed to do to retrieve the actual path to the screenshot. Any help would be appreciated! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Save yourself time and use https://crates.io/crates/ashpd Or at best, check its code :-) |
Beta Was this translation helpful? Give feedback.
Save yourself time and use https://crates.io/crates/ashpd
Or at best, check its code :-)