From 25ca77c69b0a8aa700b2d3431b180f874355e29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Thu, 30 Jul 2020 15:26:22 +0200 Subject: [PATCH] Black screening works --- src/main.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index e882c89..52c0ccf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,9 +29,10 @@ fn record_screen(config: &mut Config, valid_screens: &Vec) -> Result) -> Result Vec { .expect("Couldn't get current focus"); let stdout = String::from_utf8(output.stdout).expect("Invalid UTF-8 from get_workspaces"); - let valid_screens = stdout.split('\n').map(|s| s.to_string()).collect(); - for screen in &valid_screens { - println!("{}", screen); - } + let valid_screens = stdout + .split('\n') + .map(|s| s.to_string()) + .filter(|s| s != "") + .collect(); + + println!("Found screens: {:?}", valid_screens); + return valid_screens; } @@ -122,7 +128,6 @@ fn main() -> Result<(), Box> { workspace_blacklist: Vec::new(), }; let args: Vec = env::args().collect(); - println!("{:?}", args); let mut i = 1; loop {