Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from way-cooler/multi-output-scrape-hotfix
Browse files Browse the repository at this point in the history
Use ActiveScreen endpoint to get screen UUID
  • Loading branch information
Timidger authored Jul 30, 2017
2 parents 10d099f + 2740eab commit d38ad77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wc-grab"
description = "Screen shot taker for Way Cooler"
version = "0.1.0"
version = "0.2.0"
license = "MIT"
repository = "https://github.com/way-cooler/way-cooler-grab/"
keywords = ["Wayland"]
Expand Down
9 changes: 3 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,14 @@ fn resolution(con: &Connection) -> (u32, u32) {
let screens_msg = Message::new_method_call("org.way-cooler",
"/org/way_cooler/Screen",
"org.way_cooler.Screen",
"List")
"ActiveScreen")
.expect("Could not construct message -- is Way Cooler running?");
let screen_r = con.send_with_reply_and_block(screens_msg, WAIT_TIME)
.expect("Could not talk to Way Cooler -- is Way Cooler running?");
let screen_r = &screen_r.get_items()[0];
let output_id = match screen_r {
&MessageItem::Array(ref items, _) => {
match items[0] {
MessageItem::Str(ref string) => string.clone(),
_ => panic!("Array didn't contain output id")
}
&MessageItem::Str(ref string) => {
string.clone()
}
_ => panic!("Wrong type from Screen")
};
Expand Down

0 comments on commit d38ad77

Please sign in to comment.