4 stable releases

1.2.2 Aug 30, 2020
1.2.1 Aug 3, 2020
1.2.0 Jul 30, 2020
1.1.1 Jul 28, 2020

#2578 in Command line utilities

MIT and maybe GPL-3.0-or-later

130KB
3K SLoC

wallrnd

A configurable generator of random abstract time-aware wallpapers

License: MIT

API


This project aims to provide a utility for generating random abstract wallpapers.

Until recently it could only generate the images, not actually set them as wallpapers. This limitation is being addressed.

A bash script to automatically change wallpaper is provided, and has been tested on Ubuntu 20.04 (Focal Fossa). Portability of this script is outside of the scope of this project (the image generator however should be portable to any OS), but scripts that work for other shells/distros are welcome.


  • cargo install wallrnd --features set-wallpaper,nice

  • Make a copy of setup/wallrnd.toml and adjust the settings to your liking

  • Make a new Crontab entry: * * * * * wallrnd --config /path/to/wallrnd.toml --image /tmp/wallpaper.svg --set --nice

The --nice option causes wallrnd to lower its priority as soon as launched, which prevents the user from experiencing a short delay each time a new wallpaper is generated.

wallrnd is a more developed product than this, but if you still want to use the prototype it is possible.

Be warned that performance is a lot worse and that this version is far less configurable.

  • Edit prototype/set-wallpaper to your liking, make it executable, and add it to your $PATH.

  • Make a new Crontab entry: * * * * * set-wallpaper

psutil is used to abort the process if CPU usage is already high.

Advanced setup

You may be interested in these other setup methods if

  • your OS does not support setting an SVG image as wallpaper
  • you do not wish to use GPL- or MPL-licensed products
  • your OS is not included in this list of supported environments
  • you want custom functionality such as aborting the script when running on battery
  • you want to build from source
  • scrummage (the crate that wallrnd depends on to provide the nice feature) is not yet compatible with your OS

Installation:

  • If you do not need wallrnd to set wallpapers, then do not use the feature set-wallaper: cargo install wallrnd. The same is true if you don't want to use the nice feature.

  • If you want to be able to create png images, then you should add the make-png feature: cargo install wallrnd --features make-png

  • To have all features, you can use cargo install wallrnd --features all

  • You can also build from source:

    git clone https://github.com/Vanille-N/wallrnd
    cd wallrnd
    cargo build --release --features nice,set-wallpaper
    cp target/release/wallrnd ~/bin/wallrnd
    

Configuration

  • setup/wallrnd.toml includes examples and explanations on how to setup options. Feel free to ask for more explanations.

  • The configuration file doesn't have to be named wallrnd.toml, but it has to be formatted like a TOML file.

Automation

  • setup/set-wallpaper-* are examples of how to set wallrnd to be executed.

  • The appropriate version should be put in your path and executed whenever necessary by adding an entry to your Crontab. * * * * * set-wallpaper

  • Note that the file path does not have to be absolute. wallrnd resolves paths before writing the wallpaper to a file.


Features and licensing

While the code in this crate is licensed under the MIT license, the binary target includes (purely for user convenience) dependencies that have more restrictive licenses.

resvg and usvg require the MPL 2.0 license and pull in some other dependencies under the BSD 3-clause.

wallpaper_rs is licensed under GPL 3.0

The features provided by these crates are purely optional. The different features available are explained in more detail in the Advanced setup section.

Using the make-png feature requires MPL 2.0 or a compatible license.

Using the set-wallpaper feature requires GPL 3.0 or a compatible license.

Using both requires GPL 3.0 at least.

The inclusion of MPL- and GPL-licensed crates as dependencies of this crate licensed under MIT does not grant to anyone the right to distribute executables that were compiled using the corresponding feature flags under non-GPL-compatible licenses. Any derivative work that does not include these flags can safely be provided under the MIT license.

It is not recommended for any crates dependent on this one to use the feature flags, as the functionality obtained from the GPL dependencies is not reexported by wallrnd and thus adds needless dependencies.


Direct dependencies

dependency crate docs
serde API
serde_derive API
rand API
chrono API
delaunator API
toml API
resvg * API
usvg * API
wallpaper_rs * API
scrummage * API

* Optional dependencies


Alternative tools

Online

Scripts

Apps

Examples

As a random generator of wallpaper ought to provide images of consistent quality, the following sample of images is unfiltered*. All were created with a configuration file similar to the one provided under setup/wallrnd.toml.

* To provide a variety of patterns, tilings, and themes, the six were created in succession by altering the configuration file slightly so that only one pattern, tiling, and theme was available. This method guarantees variability without biasing quality. Hence the above sample can be considered representative of the general quality of generated wallpapers.

Dependencies

~2–4MB
~72K SLoC