From e070e55cd295515107541a5cd20cbc2cdf59f3bc Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Sun, 10 Mar 2024 22:55:18 +1100 Subject: [PATCH] Added feh handler --- README.md | 4 ++-- src/handlers/feh.rs | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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()); }