pub fn set_wallpapers_from_vec<P>(
wallpapers: Vec<P>,
default_wallpaper: P,
mode: Mode,
) -> Result<Vec<Utf8PathBuf>, WallpaperError>
Expand description
Set the background of all screens to the wallpapers of wallpapers
.
The wallpaper of screen[i]
will be set to wallpapers[i mod wallpapers.len()]
.
The default_wallpaper
param is used if the given wallpapers
vec is empty and as wallpaper for inactive screens.
Return a vec, with dose inlcude the path of the Wallpapers,
witch was set as background.
If the same wallpaper was set multiple times to different screens,
the return value does also include the wallpaper multiple times.
use more_wallpapers::{set_wallpapers_from_vec, Mode};
let images = vec!["1.jpg", "/usr/share/wallpapers/2.jpg"];
let used_wallpapers = set_wallpapers_from_vec(images, "default.png", Mode::Crop)?;
println!("background was set to the following wallpapers {used_wallpapers:?}");