Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

swww

> 编程语言
Open source

A Solution to your Wayland Wallpaper Woes

3.6K stars0 likes0 views
WebsiteGitHub

About

A Solution to your Wayland Wallpaper Woes

ATTENTION: This project has been renamed awww and moved to Codeberg

If you are interested, you can read the reasons behind it in my blog.

A Solution to your Wayland Wallpaper Woes

Efficient animated wallpaper daemon for wayland, controlled at runtime

Dependencies

  • a compositor that implements the wlr-layer-shell (typically wlroots based compositors)
  • lz4 (for compressing frames when animating)

Note that this means swww will not run on Gnome, because it does not implement the wlr-layer-shell protocol.

Build

Dependencies:

  • wayland-client and wayland-protocol .xml files installed in your system (pkg-config must be able to find it)
  • Up to date stable rustc compiler and cargo (specifically, MSRV is 1.87.0)

To build, clone this repository and run:

cargo build --release

Then, put both binaries target/release/swww and target/release/swww-daemon in your path. Optionally, autocompletion scripts for bash, zsh, fish and elvish are offered in the completions directory.

Man pages:

In order to generate the man pages, you must have scdoc installed. Run

./doc/gen.sh

The man pages will be in doc/generated. To install them, you must move them to to the appropriate location in your system. You should be able to figure out where that is by running manpath.

Nix

NixOS users can directly use this repository to get the latest swww for their system.

Add in your flake.nix:

  inputs.swww.url = "github:LGFae/swww";

Pass inputs to your modules using specialArgs and Then in configuration.nix:

  environment.systemPackages = [
    inputs.swww.packages.${pkgs.system}.swww
  ];

Features

  • Display animated gifs on your desktop
  • Display any image in the formats:
    • avif (note: must have dav1d dependency and compile with --features=avif flag)
    • jpeg
    • png
    • gif
    • pnm
    • tga
    • tiff
    • webp
    • bmp
    • farbfeld
    • svg (only static svgs are supported)
  • Clear the screen with an arbitrary rrggbb color
  • Smooth transition effect when you switch images
  • Do all of that without having to shutdown and reinitialize the daemon

Why

There are two main reasons that compelled me to make this: the first is that oguri is unmaintained and archived, despite there being serious problems with excess of memory use while displaying certain gifs (see this, for example). The best alternative I've found for oguri was mpvpaper, but if felt overkill for my purposes.

Comparing to oguri, swww uses less cpu power to animate once it has cached all the frames in the animation. It should also be significantly more memory efficient.

The second is that, to my knowledge, there is no wallpaper daemon for wayland that allows you to change the wallpaper at runtime. That is, in order to, for example, cycle through the images of a directory, you'd have to kill the daemon and restart it. Not only does it make simple shell scripts a pain to write, it makes switching from one image to the next to happen very abruptly.

Usage

Start by initializing the daemon:

swww-daemon

Then, in a different terminal, simply pass the image you want to display:

…

If you would like to know the valid values for <outputs>, you can query the daemon. This will also tell you what the current image being displayed is, as well as the dimensions detected for the outputs. If you need more detailed information, I would recommend using wlr-randr.

swww query

Finally, to stop the daemon, kill it:

swww kill

For a more complete description, run swww --help or swww <subcommand> --help.

Finally, to get a feel for what you can do with some shell scripting, check out the example_scripts folder. It can help you get started.

Transitions

Example wipe transition:

wipe transition with angle set to 30 deg

The left, right, top and bottom transitions all work similarly.

Example outer transition

The center transition is the opposite: it starts from the center and goes towards the edges.

There is also simple, which simply fades into the new image, any, which starts at a random point with either center of outer transitions, and random, which selects a transition effect at random.

Troubleshooting

High cpu usage during caching of a gif's frames

swww will use a non-insignificant amount of cpu power while caching the images. This will be specially noticeable if the images need to be resized before being displayed. So, if you have a very large gif, I would recommend resizing it before sending it to swww. That would make the caching phase much faster, and thus ultimately reduce power consumption. I can personally recommend gifsicle for this purpose.

Wallpaper disappears when reconnecting monitor

swww used to cache its images so that it could reload the current the last displayed image automatically. This lead to many problems and also proved to be very annoying to keep working with when we updated to sctk 0.17. So I decided to nuke it.

If you want a wallpaper to be set automatically when you reconnect to a monitor, you should use a combination of scripts and a program that lets you run commands when a new output is connected, like kanshi.

About new features

Broadly speaking, NEW FEATURES WILL NOT BE ADDED, UNLESS THEY ARE EGREGIOUSLY SIMPLE. I made swww with the specific usecase of making shell scripts in mind. So, for example, stuff like timed wallpapers, or a setup that loads a different image at different times of the day, and so on, should all be done by combining swww with other programs (see the example_scripts for some examples).

If you really want some new feature within swww itself, I would recommend forking the repository.

Alternatives

swww isn't really the simplest, mostest minimalest software you could find for managing wallpapers. If you are looking for something simpler, have a look at the awesome-wayland repository list of wallpaper programs . I can personally recommend:

  • wbg - probably the simplest of them all. Strongly recommend if you just care about setting a single png as your permanent wallpaper on something like a laptop.
  • swaybg - made by the wlroots gods themselves.
  • mpvpaper - if you want to display videos as your wallpapers. This is also what I used for gifs before making swww.
  • kitty - you can use the kitty terminal emulator with its panel kitten to have the output of an arbitrary TUI program such as htop or btop or similar as your desktop wallpaper.

Acknowledgments

A huge thanks to everyone involved in the smithay project. Making this program would not have been possible without it. In fact, the first versions of swww were quite literally copy pasted from the layer shell example in the client-toolkit .

A big thank-you also to HakierGrzonzo, for setting up the AUR package.

Wallpapers used in this README

Pixel Art, by Waneella - https://www.patreon.com/waneella

Gradient - https://www.behance.net/gallery/86128681/Free-Unicorn-Vector-Gradients

Silhouette of Skyway - https://unsplash.com/photos/silhouette-of-skyway-UUJzCuHUfYI

GitHub Issues· 41 open

View all on GitHub
  • #491

    qoestion: how swww works?

    documentationUpdated Oct 15, 2025
  • #478

    swww appears to destroy HDMI display after return from DPMS OFF resulting in black screen

    bughas workaroundUpdated Oct 7, 2025
  • #483

    [Feature Request] Support for Apple `heic` dynamic wallpaper or GNOME dynamic timed wallpapers

    Updated Sep 24, 2025
  • #390

    Support JPEG XL (`.jxl`)

    upstreamUpdated Sep 23, 2025
  • #342

    issue with --no-resize

    bugUpdated Sep 13, 2025
  • #477

    tga wallpaper dont work

    bugUpdated Sep 12, 2025
  • #404

    Can't start swww-daemon

    Updated Sep 7, 2025
  • #471

    [Feature Request] Option to output swww query information as json

    enhancementUpdated Sep 2, 2025
  • #468

    Support animations with transparency (alpha channel)

    enhancementUpdated Sep 1, 2025
  • #370

    SWWW restores wallpaper in only one monitor.

    Updated Aug 19, 2025

Highlights

  • •a compositor that implements the wlr-layer-shell (typically wlroots based compositors)
  • •lz4 (for compressing frames when animating)
  • •wayland-client and wayland-protocol .xml files installed in your system (pkg-config must be able to find it)
  • •Up to date stable rustc compiler and cargo (specifically, MSRV is 1.87.0)
  • •Display animated gifs on your desktop
  • •Display any image in the formats:
  • •farbfeld
  • •svg (only static svgs are supported)
  • •Clear the screen with an arbitrary rrggbb color
  • •Smooth transition effect when you switch images

> Tags

Rustswwwwallpaperwayland

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言