A tool to display videos and SDL content as a wallpaper on linux minimalist window managers using Xorg
example.mp4
You can either run it from source or install it with :
$ cargo install wallpepper
To run this, you will need ffmpeg and SDL2 installed via your package manager along with their header files (sometimes bundled together, just look it up on your distro's wiki)
The basic usage for wallpepper is as follows :
$ wallpepper <wallpaper> [wallpaper args]
Currently, three wallpapers are supported:
- chroma, which is just a rainbow
- video, which will display the video file specified in a loop using ffmpeg
- outrun, which displays a cool outrun sunset animation
$ wallpepper chroma
$ wallpepper video path/to/video.mp4
You may want to add this to your .xinitrc to have your wallpaper of choice started automatically :
# ...
wallpepper video ~/Videos/mycoolwallpaper.mp4 &
exec dwm # or whatever your window manager isWallpepper uses SDL2 and the X11 libraries to draw directly to the root window, on minimalist window managers this will be your background. Others though, like plasma or gnome will draw over this root window so it won't be visible.
You can create your own animated wallpapers using SDL2 with just a few steps:
- Create a new module for your wallpaper in
wallpapers/ - Create a new struct for your wallpaper, you can put whatever you need here
- Implement the
Wallpapertrait on your struct - Add it to
wallpapers/mod.rs(see lines 3 and 21 for an example) - That's it! You can now try your wallpaper with the name you gave it in the
get_wallpaper_by_namefunction! - Optional: If you want, you can set the
TESTconstant totrueto have your wallpaper open in a floating window instead. - Optional: Make a pull request to add your wallpaper to the defaults 😎