12 releases (3 stable)

1.0.2 Mar 8, 2024
1.0.1 Feb 25, 2024
0.2.2 Feb 18, 2024
0.1.5 Feb 15, 2024

#436 in GUI

Download history 12/week @ 2024-02-05 528/week @ 2024-02-12 224/week @ 2024-02-19 135/week @ 2024-02-26 100/week @ 2024-03-04 33/week @ 2024-03-11 175/week @ 2024-04-01

219 downloads per month
Used in ruin

MIT license

21KB
458 lines

WLRS /wɔːlrəs/ crate Build Status codecov docs

Rust library for managing wallpapers

Supported environments

  • Every Wayland compositor that implements layer-shell (e.g. Hyprland, Sway, Wayfire, etc.)
  • X11 environments that don't have their own wallpaper management (e.g. dwm, i3, bspwm, etc.)

Examples:

Setting from memory:

use wlrs::set_from_memory;

fn main() {
  // Set to first monitor
  let wallpaper = image::open("wallpaper.jpg").unwrap();
  set_from_memory(wallpaper, vec![0]).unwrap();

  // Set to multiple monitors
  let wallpaper = image::open("wallpaper.jpg").unwrap();
  set_from_memory(wallpaper, vec![0, 1]).unwrap();

  // Set to all monitors
  let wallpaper = image::open("wallpaper.jpg").unwrap();
  set_from_memory(wallpaper, Vec::new()).unwrap();
}

Setting from file path:

use wlrs::set_from_path;

fn main() {
  // Set to first monitor
  set_from_path("wallpaper.jpg", vec![0]).unwrap();

  // Set to multiple monitor
  set_from_path("wallpaper.jpg", vec![0, 1]).unwrap();
  
  // Set to all monitors
  set_from_path("wallpaper.jpg", Vec::new())unwrap();
}

Dependencies

~26–37MB
~445K SLoC