diff --git a/Cargo.lock b/Cargo.lock index 87dd59c..3b77251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,7 +354,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wallpaper" -version = "1.0.0" +version = "1.0.1" dependencies = [ "clap", "ctrlc", diff --git a/Cargo.toml b/Cargo.toml index dadcde0..f7b69be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wallpaper" -version = "1.0.0" +version = "1.0.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/daemon/state.rs b/src/daemon/state.rs index 8a36b49..d07ea7b 100644 --- a/src/daemon/state.rs +++ b/src/daemon/state.rs @@ -127,14 +127,14 @@ impl State { self.history.go_next(); } else { // If not enough space delete one element - let mut idx = fs::read_dir(&self.image_dir).unwrap() + let mut idx = fs::read_dir(&self.image_dir) + .unwrap() .filter_map(|res| res.ok().map(|e| e.path())) - .position(|elem| { - elem == *self.history.previous.back().unwrap() - }) + .position(|elem| elem == *self.history.previous.back().unwrap()) .unwrap_or(0); - let num_pics = fs::read_dir(&self.image_dir).unwrap() + let num_pics = fs::read_dir(&self.image_dir) + .unwrap() .filter_map(|res| res.ok().map(|e| e.path())) .count(); @@ -146,10 +146,11 @@ impl State { } self.history.push_back( - fs::read_dir(&self.image_dir).unwrap() + fs::read_dir(&self.image_dir) + .unwrap() .filter_map(|res| res.ok().map(|e| e.path())) .nth(idx) - .unwrap() + .unwrap(), ); } } @@ -176,7 +177,8 @@ impl State { match &self.wallpaper_cmd { WallpaperMethod::Feh => { let mut process = Command::new("feh") - .arg("--bg-scale") + .arg("--bg-fill") + .arg("-r") .arg(path) .spawn() .unwrap();