Wallpaper daemon for Wayland

Overview

wpaperd

GitHub release (latest by date) GitHub license GitHub Workflow Status

wpaperd is a minimal wallpaper daemon for Wayland. It allows the user to choose a different image for each output (aka for each monitor) just as swaybg. Moreover, a directory can be chosen and wpaperd will randomly choose an image from it. Optionally, the user can set a duration, after which the image displayed will be changed with another random one.

Features

  • Choose your wallpaper for each input
  • Randomly choose an image from a directory
  • Change the random image after a set duration
  • Configurable via a TOML configuration file
  • Reload config at runtime and apply new settings
  • Written entirely in Rust, it has no system dependencies

Getting started

Build

To install wpaperd, clone the repository and build the project:

$ git clone https://github.com/danyspin97/wpaperd
$ cd wpaperd
$ cargo build --release

Install

You can install wpaperd using cargo:

$ cargo install --path="."

Otherwise you can install it using rinstall:

# First generate the man page
$ scdoc < man/wpaperd-output.5.scd > man/wpaperd-output.5
$ rinstall -y

To run it, execute the wpaperd program:

$ wpaperd

If you want to automatically run it at startup, add this line to your sway configuration (located in $HOME/.config/sway/config) depending on your installation method:

# For installation using cargo
exec ~/.cargo/bin/wpaperd
# For installation using rinstall
exec ~/.local/bin/wpaperd

Output Configuration

The output configuration file for wpaperd is located in XDG_CONFIG_HOME/wpaperd/output.conf (which defaults to $HOME/.config/wpaperd/output.conf) and is a TOML file. Each section represents a different output and contains the following keys:

  • path, path to the image/directory
  • duration, how much time the image should be displayed until it is changed with a new one. This is only valid when path points to a directory. (Optional)

The section default will be used as fallback for the all the outputs that aren't listed in the config file. This is an example configuration:

[default]
path = "/home/danyspin97/Pictures/Wallpapers/"
duration = "30m"

[eDP-1]
path = "/home/danyspin97/Pictures/Wallpapers/github_octupus.png"

If you're running sway, you can look for the available outputs and their ID by running:

$ swaymsg -t get_outputs

Every time you update the configuration while the program is running, the changes will be applied automatically.

TODO

wpaperd is still a work in progress. The next things to do, in order, are:

  • Configurable upscaling algorithm, right now Lanzcos3 is always used
  • Add different modes to apply the wallpaper, i.e. center, fit, original

License

wpaperd is licensed under the GPL-3.0+ license.

Comments
  • Can't compile on Arch

    Can't compile on Arch

    I'm unable to compile the code. I'm using wpaperd package from the AUR, and I've also tried wpaperd-git. Both can't compile and error out on the same line. Here's the error:

       Compiling scopeguard v1.1.0
       Compiling hashbrown v0.11.2
       Compiling os_str_bytes v6.0.0
       Compiling adler v1.0.2
    error[E0658]: the `unsafe_op_in_unsafe_fn` lint is unstable
       --> /home/tralph3/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.0.0/src/lib.rs:159:1
        |
    159 | #![forbid(unsafe_op_in_unsafe_fn)]
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: see issue #71668 <https://github.com/rust-lang/rust/issues/71668> for more information
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0658`.
    error: could not compile `os_str_bytes`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    ==> ERROR: A failure occurred in build().
        Aborting...
    error: failed to build 'wpaperd-0.2.0-1':
    error: packages failed to build: wpaperd-0.2.0-1
    checking dependencies...
    
    Package (1)  Old Version  Net Change
    
    scdoc        1.11.2-4      -0.03 MiB
    
    Total Removed Size:  0.03 MiB
    
    :: Do you want to remove these packages? [Y/n]
    :: Processing package changes...
    (1/1) removing scdoc                                                                                 [------------------------------------------------------------] 100%
    :: Running post-transaction hooks...
    (1/1) Arming ConditionNeedsUpdate...
    
    opened by tralph3 3
  • NoWaylandLib

    NoWaylandLib

    Hi there! I'm seeing the following error:

    $ wpaperd
    The application panicked (crashed).
    Message:  called `Result::unwrap()` on an `Err` value: NoWaylandLib
    Location: src/main.rs:120
    

    I'm running:

    • Sway 1.6.1
    • wpaperd 0.1.1 (as an aside it still says 0.1.0 with -V)

    I've not got swaybg or anything else I could think of as pertinent running.

    I'm using this NixOS derivation:

    { fetchurl, stdenv }:
    
    stdenv.mkDerivation rec {
      pname = "wpaperd";
      version = "0.1.1";
    
      src = fetchurl {
        url = "https://github.com/danyspin97/wpaperd/releases/download/${version}/wpaperd-x86_64-unknown-linux-musl.tar.zst";
        sha256 = "12c874049c6b04c606746401dafe41d8c715988744747621333134690699fe16";
      };
    
      installPhase = ''
        mkdir -p $out/bin/
        mv ../wpaperd $out/bin/wpaperd
      '';
    }
    

    Could be a missing system dependency, a user permissions issue, I don't know. I tried this debug advice but the directory is empty.

    If you have any ideas let me know, else I can clone and try debugging from source.

    opened by samhh 3
  • No wallpaper in Sway 1.7

    No wallpaper in Sway 1.7

    Running the program in Sway using

    • exec wpaperd in config
    • swaymsg exec wpaperd
    • wpaperd

    fails to display any change to the wallpaper, though the program still runs in the background.

    Originally part of #3.

    opened by Mrfiregem 3
  • 2 different images on 2 different screens/monitors

    2 different images on 2 different screens/monitors

    My configuration file is the following: [default] path = "/home/mathias/Pictures/desktop_wallpapers" duration = "30m" where the path contains 2 images. but the result is that my laptop screen and monitor screen got 2 different images. Is this normal or is there a way to 'sync' them that they display the same image?

    opened by mathiasbolle 2
  • Rapid switching when certain programs open

    Rapid switching when certain programs open

    When using programs like swaylock or nwg-drawer, or receiving a notification in mako, the wallpaper will switch twice, once when opening, and once when closing the app or notification. This is on river 0.1.2, which uses wlroots 0.15.

    I also tried to see if it happened on sway 1.7 which also uses the newest wlroots, but the image doesn't show up regardless of if the path is a folder or file.

    opened by Mrfiregem 2
  • Add a shadow on the bottom of the status bar

    Add a shadow on the bottom of the status bar

    Taking the idea and the implementation from https://github.com/ordy/dotfiles/blob/master/.config/sway/panel-shadow.py , I think it would be a cool (optional) feature to have. It requires creating a second WlSurface for every output, and then applying the gradient on top of it. Another way to implement it would be applying the gradient directly on the image, but the image crate does not support that.

    opened by danyspin97 1
  • Question

    Question

    Hi, I'm trying to write a swaybg clone for https://github.com/waycrate and to learn about layer shell I'm reading through your source code.

    Would you mind if I shamelessly copied some parts? I know the source code is licensed under GPLv3 but I thought I'd ask nonetheless.

    opened by Shinyzenith 1
  • feat: Added Nix Flake support

    feat: Added Nix Flake support

    Added Nix Flake support to this repository so that anyone using Nix can use this project. Tested on my own system, works really well, thanks for the tool, it's awesome!

    oh, also, if it's were possible to own a cachix instance, it would mean that Nix results would be cached (and so the build would be done once only). I can take care of everything, or you can take the free instance for open source here, and I can take care of the GitHub Action setup. As you wish!

    opened by Narice 0
  • Opening the image fails with insufficient memory

    Opening the image fails with insufficient memory

    Hi, I have a problem that 2 wallpapers don't want to be set by wpaperd. Also I have lots of files in .local/state/wpaperd with following content:

    WARN [calloop::sources::ping] [calloop] Failed to write a ping: EPIPE
    

    log Maybe the files are problematic but I don't know since insufficient memory is not helpful because it is able to process much bigger files. Wallpapers: 1 2 OS: Arch 5.19.12 WM: dwl wlroots 0.15.1 wpaperd 0.2.0 CPU: Ryzen 5 4600H GPU: Integrated + Nvidia GTX 1650 (515.76)

    opened by pm4rcin 5
  • Add transitions between images

    Add transitions between images

    This would be really hard to implement, because it would need to be draw manually starting from the two images and frame per frame. But it would really be nice to have.

    opened by danyspin97 1
Releases(0.2.0)
Owner
Danilo Spinella
I am a passionate engineering student who loves Unix related stuff.
Danilo Spinella
Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb.

Wallpaperflix Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb. Prerequisities https://tauri.app/v1/guides/gett

İsmail Karslı 2 Sep 8, 2022
Steno for Wayland

WayPlover Steno for Wayland Description A Steno Stroke Interpreter for Wayland. Open Steno Project Learn Plover Usage wayplover --port /dev/ttyACM0 --

Travis Davis 9 Oct 23, 2022
Turn off monitors to save power (for Wayland)

Same as xset dpms force off, but for Wayland. It requires zwlr_output_power_manager_v1 and org_kde_kwin_idle support from the Wayland compositer. wlro

依云 15 Dec 8, 2022
Dynamic key remapper for X11 and Wayland

???????????? ⌨️ xremap is a key remapper for Linux. Unlike xmodmap, it supports app-specific remapping and Wayland. Concept Fast - Xremap is written i

Takashi Kokubun 643 Jan 8, 2023
Default implementation of the Wayland protocol for use with wl

Wayland An implementation of core Wayland interfaces and convenience functions for accelerating the development of Wayland clients and servers using t

AidoP 1 Jan 24, 2022
A simple clipboard manager for wayland.

Wpilman A simple clipboard manager for wayland. Installation Just compile it yourself or install the AUR package: paru -S wlipman-git # or yay -S wlip

null 3 Jan 13, 2023
Wayland clipboard manager that will make you clap 👏

Clapboard - clipboard manager that makes you clap ?? Clapboard is a simple clipboard manager for Wayland, built in Rust. It saves a history of your cl

Yo'av Moshe 18 Jan 28, 2023
Swayidle alternative to handle wayland idle notifications, sleep and lock events in Rust with Lua scripting based configuration language

swayidle-rs This is intended as a replacement of sway's idle management daemon. I use it as a tool to understand rust message passing and state manage

Reza Jelveh 8 Nov 27, 2023
xdotool-like for KDE Wayland

kdotool - a xdotool clone for KDE Wayland Introduction Wayland, for security concerns, removed most of the X11 APIs that xdotool uses to simulate user

Jin Liu 25 Dec 3, 2023
s3d is an S3 daemon for the Edge written in Rust

s3d is an S3 daemon for the Edge written in Rust The goal of s3d is to provide a daemon for edge platforms (e.g. factory servers ?? planes ?? ships ??

null 36 Dec 27, 2022
Wallpaper daemon for Wayland

wpaperd wpaperd is a minimal wallpaper daemon for Wayland. It allows the user to choose a different image for each output (aka for each monitor) just

Danilo Spinella 53 Dec 28, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
🏝️ Set wallpaper from your terminal!

WLP Set wallpaper from your terminal. It works on Linux, Mac and Windows. Installation Manual git clone https://github.com/ahmadrosid/wlp.git cargo in

ahmadrosid 7 Dec 28, 2022
Deadliner helps you keep track of the time left for your deadline by dynamically updating the wallpaper of your desktop with the time left.

Deadliner Watch the YouTube video What's Deadliner? Deadliner is a cross-platform desktop application for setting deadline for a project and keeping t

Deadliner 34 Dec 16, 2022
Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb.

Wallpaperflix Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb. Prerequisities https://tauri.app/v1/guides/gett

İsmail Karslı 2 Sep 8, 2022
Wallrus is a simple wallpaper manager for linux.

wallrus Wallrus is a simple and blazing-fast wallpaper manager for linux. It wraps around feh to provide a simple, fast, feature-rich and user-friendl

Akshay Rajput 9 Oct 10, 2022
"Philips Ambilight for desktops". A tool to generate color palettes from your desktop wallpaper and send them to Home Assistant.

Desktop Dye DesktopDye is an open source project written in Rust that allows users to have their lights paired with Home Assistant adjust to the most

Jeroen Meijer (Jay) 7 Feb 22, 2023
Steno for Wayland

WayPlover Steno for Wayland Description A Steno Stroke Interpreter for Wayland. Open Steno Project Learn Plover Usage wayplover --port /dev/ttyACM0 --

Travis Davis 9 Oct 23, 2022
`xrandr` for Gnome/wayland, on distros that don't support `wlr-randr`

gnome-randr-rust A reimplementation of xrandr for Gnome on Wayland, especially for systems that don't support wlr-output-management-unstable-v1 (e.g.

Max Ainatchi 40 Dec 21, 2022
Turn off monitors to save power (for Wayland)

Same as xset dpms force off, but for Wayland. It requires zwlr_output_power_manager_v1 and org_kde_kwin_idle support from the Wayland compositer. wlro

依云 15 Dec 8, 2022