Expand description

Yet another wallpaper crate, which can set a wallpapers per screen.

The main feature over other crates like wallpaper or wall is the ability to set different wallpapers on different screens. Currently this feature is only implemented for some enviroments. Because of this you can enable the “wallpaper” feature, which uses the wallpaper crate as a fallback on unsupported environments. This means you can use the additonal features of this crate and still support the large amount of supported enviroments of the wallpaper crate.

Currently the following enviroments are supported:

enviromentset wallpaperset wallpaper per screenrequirements
Windowsfeatures=["wallpaper"]
MacOSfeatures=["wallpaper"]
X11xwallpaper
Budgie(wayland)features=["wallpaper"]
Deepin(wayland)features=["wallpaper"]
GNOME(wayland)features=["wallpaper"]
KDExrandr, dbus
Mate(wayland)features=["wallpaper"]
Swayfeatures=["wallpaper"], swaybg
some other wayland desktopsfeatures=["wallpaper"], swaybg, dektop must support wlr-layer-shell protocol and wl_output version 4

The information about the currently supported features are also provided by Enviroment.



QuickStart / Examples:
If you would like to set only a different wallpaper for each screen and don’t care which wallpaper is used on which screen, you can use set_wallpapers_from_vec() or set_random_wallpapers_from_vec():

use more_wallpapers::Mode;

let images = vec!["/usr/share/wallpapers/1.jpg", "/usr/share/wallpapers/2.jpg"];
more_wallpapers::set_wallpapers_from_vec(images, Mode::Crop)?;

For advanced wallpaper settings you can use the WallpaperBuilder:

use more_wallpapers::{Mode, WallpaperBuilder};

let fallback_images = vec!["/usr/share/wallpapers/1.jpg", "/usr/share/wallpapers/2.jpg"];
WallpaperBuilder::new()?.set_wallapers(|i, screen| -> (String, Mode) {
	if i == 0 {
		return (
			"/usr/share/wallpapers/first.jpg".to_owned(),
			Mode::default(),
		);
	}
	if screen.name == "HDMI1" {
		return ("/usr/share/wallpapers/hdmi.jpg".to_owned(), Mode::Fit);
	}
	(
		fallback_images[i % fallback_images.len()].to_owned(),
		Mode::Tile,
	)
})?;

Modules

Structs

include information about a connected screen

Builder for advance Wallpaper settings and informations. This struct should not be stored for a long time, because it can become outdated if the user connect or disconnect monitors or change the Display settings.

Enums

Represent the used operating system or dekstop. Inform about supported features, at the curren enviroment.

define how the wallpaper will be stretch, zoom, repeated etc

Functions

Like set_wallpapers_from_vec, but map the wallpapers randomly to the screens. Selecting the same wallpaper multiple time will be avoid, if this is possible.

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()]. 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.