9 releases

0.3.1 Mar 9, 2023
0.3.0 Nov 28, 2022
0.2.5 Nov 27, 2022
0.1.0 Nov 27, 2022

#199 in Images

Download history 2/week @ 2024-02-23 2/week @ 2024-03-01 2/week @ 2024-03-08 3/week @ 2024-03-15 90/week @ 2024-03-29

95 downloads per month

GPL-3.0-or-later

390KB
113 lines

wallpapergen

crates.io GNU GPL 3.0 or later

A CLI tool for generating gradient wallpapers.

View samples

Installation

If you don't have Rust, follow the installation instructions here.

Run the following command to install wallpapergen:

cargo install wallpapergen

Usage

Run the following command to view help:

wallpapergen --help

If the command isn't found, you will need to add ~/.cargo/bin to your path.

echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.bashrc
source ~/.bashrc

If you're using zsh, replace ~/.bashrc with ~/.zshrc.

Examples

Here is the command used to generate the samples seen below:

wallpapergen -W 825 -H 350 \
    -c '#f2cdcd' \
    -c '#f5c2e7' \
    -c '#cba6f7' \
    -c '#f38ba8' \
    -c '#eba0ac' \
    -c '#fab387' \
    -c '#f9e2af' \
    -c '#a6e3a1' \
    -c '#94e2d5' \
    -c '#89dceb' \
    -c '#74c7ec' \
    -c '#89b4fa' \
    -c '#b4befe'

(These colors are from catppuccin)

Issues

This project is very early and may be buggy. Please file an issue if you have a problem.

Troubleshooting

  • Output paths passed in quotes may fail, prefer -o ~/example.png over -o '~/example.png' when possible.
  • Wallpapers generated within 1ms of each other will overwrite if no output path is specified. This occurs because the default filename includes the time in milliseconds.

Window manager integration

This program will print the path of the output file before it exits, so you can use xargs to pipe it to your wallpaper program. Here's my personal script:

wallpapergen -o ~/.wallpaper.png \
    -W 3440      \
    -H 1440      \
    -c '#f2cdcd' \
    -c '#f5c2e7' \
    -c '#cba6f7' \
    -c '#f38ba8' \
    -c '#eba0ac' \
    -c '#fab387' \
    -c '#f9e2af' \
    -c '#a6e3a1' \
    -c '#94e2d5' \
    -c '#89dceb' \
    -c '#74c7ec' \
    -c '#89b4fa' \
    -c '#b4befe' \
    | xargs -I{} swww img {}      \
        --transition-type  'grow' \
        --transition-speed '20'   \
        --transition-fps   '100'  \
        --transition-pos   0.5,0.5

Unnecessary, but it removes the need to repeat the output file path without using a variable.

Samples

Wallpaper sample 1 Wallpaper sample 2 Wallpaper sample 3 Wallpaper sample 4

Dependencies

~18–29MB
~260K SLoC