diff --git a/README.md b/README.md index 85f59d0..1b66d25 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ Simple tool that selects random wallpapers and applies them as your background Whats needed to get feature parity - d-bus communications with Plasma [✓] -- Support for simple background engines like feh [] +- Support for simple background engines like feh [✓] - Support for [ultrawide, horizontal, vertical] displays [✓] What still needs to be done - Code cleanup [] -- Handler for feh [] +- Handler for feh [✓] What I want to add diff --git a/src/handlers/feh.rs b/src/handlers/feh.rs index 6bd39cc..61f0ec7 100644 --- a/src/handlers/feh.rs +++ b/src/handlers/feh.rs @@ -1,5 +1,15 @@ use crate::Wallpapers; +use std::process::Command; + pub fn change_wallpapers(wallpapers: &Wallpapers) { - println!("Not implemented"); + let mut command = Command::new("/usr/bin/feh"); + command.arg("--no-fehbg").arg("--bg-fill"); + + for monitor in wallpapers.config.monitors.monitors.iter() { + command.arg(wallpapers.random_selection(monitor).to_string()); + } + + let _result = command.output(); + println!("{:?}", command.get_args()); }