20 stable releases
3.0.0-alpha | Feb 14, 2024 |
---|---|
2.10.0 | Jan 26, 2024 |
2.9.0 | Dec 26, 2023 |
2.7.1 | Sep 24, 2023 |
1.0.0 | Mar 30, 2023 |
#132 in Command line utilities
425 downloads per month
195KB
3.5K
SLoC
wallust - Generate colors from an image
sources: adwaita - scenic view of mountains - rms by marco novo - pixels - linus talking
If comming from v2, please check how to prepare for v3.
Usage
wallust run my_wallpaper.png
use wallust -h
for an overview and wallust --help
for a more detailed explanation
Features
- Includes man pages and completions!
- Sets terminal colors on all active terminals
- Updates
settings.json
on Windows Terminal, to enable this scheme for the first time you will have to selected it manually - *NIX: ASCII escape sequences:
/dev/pts/
on Linuxps
to search active terminals on OpenBSD
- MacOS: iTerm2 sequences,
/dev/ttys00
on MacOS - Windows: Adds a color scheme for the windows terminal
- Updates
- Cache scheme palettes, overwritten by
-w
- Linux:
$XDG_CACHE_HOME
or$HOME/.cache
- MacOs:
$HOME/Library/Caches
- Windows:
{FOLDERID_LocalAppData}
- Linux:
- Read pywal/terminal-sexy colorschemes with
cs
subcommand - Built-in pywal themes with the
theme
subcommand (can be disabled with compile-time features)wallust theme --help
to list possible themes - Configuration file,
wallust.toml
:- When no config file, the default config file will be generated
- Optional templating with two different engines:
- Default is using usual
{variable}
- By enabling
new_engine = true
, you use{{variable}}
- Default is using usual
- Configurable methods for backends, colorspaces and palettes (chart below)
- Configurable threshold
- Linux:
$XDG_CONFIG_HOME
or$HOME/.config
- MacOs:
$HOME/Library/Application Support
- Windows:
{FOLDERID_RoamingAppData}
Methods | Description |
---|---|
Backends | How to extract the colors from the image. (e.g pywal uses convert) |
ColorSpace | Get the most prominent color, and sort them according to the Palette , configurable by a threshold |
Palette | Makes a scheme palette with the gathered colors, (e.g. sets light background) |
Make sure to read the sample config file for practical documentation.
For detailed docs:
man wallust
, overall info;man wallust.5
, config docs;man wallust-subcommand
, displays a man page for subcommand.
Installation
wallust
doesn't require third party packages, but has an optional
dependency: imagemagick
to use the wal
backend
(just like pywal). Other methods are built in.
Distros Packages
NetBSD
If you are using NetBSD, a native package is available from the official repositories. To install it, simply run:
pkgin install wallust
Nix
If you are using Nix, a native package is available for the unstable channel.
Install it for your profile:
nix-env -iA nixos.wallust # change `nixos` for `nixpkgs`, if on a non-NixOS system
Try it with nix-shell
nix-shell -p wallust
Arch User Repository (AUR)
Using an Arch based distro, you can use the wallust or wallust-git packages.
wallust
fetches the latest stable version fromstatic.crates.io
, which mirrors themaster
branch. Prefer this package.wallust-git
fetches the latest unstable version from thedev
branch.
Either can be installed on an Arch based distro with the following commands:
git clone https://aur.archlinux.org/wallust.git # Or wallust-git.git
cd wallust # or wallust-git
makepkg -si
Binary
Go to the releases
and download the tar.gz
file, which contains a binary for musl, so it should
work for most *nix platforms.
tar -xf wallust-TARGET.tar.gz
Build from source
The master branch is stable
From this repo
Go to the releases
page and download the .zip
or .tar.gz
repository. After extracting the contents,
go to the directory (cd MAYOR.MINOR.PATCH
).
Recommended way is to use the Makefile
, since this will install man pages and completions.
- Edit
Makefile
to meet your local setup (should be fine as is for most linux distros). - Build it with
make
- Install wallust (if necessary as root):
make install
Then you can do the following, which moves the binary into your $CARGO_HOME/bin
cargo install --path .
or build it and copy the binary to one folder present in your $PATH
like
/usr/local/bin
cargo build --release
cp -f ./target/release/wallust /usr/local/bin
From crates.io
cargo install wallust
This will use the lastest version
Packaging
Binary-based distros can grab the latest pre-compiled binary from the releases page.
Source-based distros, if they wish to build wallust
from source, must ensure
that the following dependencies are available:
- Build Dependencies:
- Rust (
cargo
,rustc
) - make (or install man pages and completions manually)
- Rust (
- Runtime Dependencies
imagemagick
is required only for thewal
backend, such limiting should be mentined and considered an optional dependency, since all other backends work without it.
Makefile
Using make
is optional if you know your way into cargo and can accept
the job to manually install man pages, completions and the binary.
I've only added a Makefile
to simplify installing these assets, as well as
the binary. By default make
uses native compilation, you can define your
wished target like this:
Building
$ TARGET=x86_64-pc-windows-gnu make install CARGOFLAGS="--release --target=$TARGET"
Installing
# TARGET=x86_64-pc-windows-gnu make CARGOFLAGS="--release --target=$TARGET" RELEASE="target/$TARGET/release"
Don't forget that make
by itself runs cargo
in order to built the binary.
It's common on projects that use make to split building in two steps, given
that make install
requires permissions to write on $DESTDIR$PREFIX
.
Contribute!
Use the dev branch
Show some of your taste by adding a backend, colorspace, scheme palettes, and/or a custom theme.
Having design ideas or suggestios is also very welcome.
TODOs
for more, grep the src for TODO rg TODO
- automate binary releases with a CI, figure out woodkeeper codeberg CI
- use
thiserror
for errors in the modules (there aren't that many)
Related
- wallust-themes - built in wallust colorschemes
- pywal - 🎨Generate and change color-schemes on the fly
- pywal16 - 16 colors fork of pywal
- wpgtk - 🎴a colorscheme, wallpaper and template manager for *nix
- wal-theme-picker - pick the best theme for the image (rather than generating one)
- pigmnts - 🎨Color palette generator from an image using WebAssesmbly and Rust
- Chameleon - 🦎Theme your linux system to match any image
- lule_bash - Genretare all 255 colors from wallpapers
- lule -
lule_bash
rewriten for efficiency - using vscode-wal-theme with
wallust
- base16 - Framework for Tomorrow styled themes
- flavours - 🎨💧An easy to use base16 scheme manager that integrates with any workflow
- oxidec - Eye-candy manager written in Rust
- raventhemer - A theme manager and switcher for desktop linux
- rose-pine Issue #2 - Ideas with using the whole 15 color palette
Dependencies
~22–34MB
~331K SLoC