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:
| enviroment | set wallpaper | set wallpaper per screen | requirements |
| --- |:---:|:---:| --- |
| Windows | ✅ | ❌ | features=["wallpaper"]
|
| MacOS | ✅ | ❌ | features=["wallpaper"]
|
| X11 | ✅ | ✅ | xwallpaper |
| Budgie(wayland) | ✅ | ❌ | features=["wallpaper"]
|
| Deepin(wayland) | ✅ | ❌ | features=["wallpaper"]
|
| GNOME(wayland) | ✅ | ❌ | features=["wallpaper"]
|
| KDE | ✅ | ✅ | xrandr, dbus |
| Mate(wayland) | ✅ | ❌ | features=["wallpaper"]
|
| Sway | ✅ | ❌ | features=["wallpaper"]
, swaybg |
| some other wayland desktops | ✅ | ❌ | features=["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()
:
```rust use more_wallpapers::Mode;
let images = vec!["/usr/share/wallpapers/1.jpg", "/usr/share/wallpapers/2.jpg"]; morewallpapers::setwallpapersfromvec(images, Mode::Crop)?; ```
For advanced wallpaper settings you can use the WallpaperBuilder
:
```rust use more_wallpapers::{Mode, WallpaperBuilder};
let fallbackimages = vec!["/usr/share/wallpapers/1.jpg", "/usr/share/wallpapers/2.jpg"]; WallpaperBuilder::new()?.setwallapers(|i, screen| -> (String, Mode) { if i == 0 { return ( "/usr/share/wallpapers/first.jpg".toowned(), Mode::default(), ); } if screen.name == "HDMI1" { return ("/usr/share/wallpapers/hdmi.jpg".toowned(), Mode::Fit); } ( fallbackimages[i % fallbackimages.len()].to_owned(), Mode::Tile, ) })?; ```