wallrust-1.0.2 is not a library.
Wallrust
A blazingly fast and feature-rich tool for image color palette extraction and theme generation, inspired by wallbash.
Installation
archlinux
wallrust is pushed to the arch AUR.
use pre-built binary(recommended):
build from source:
cargo
download binaries from releases
make sure to add ~/.local/bin to your $PATH
#bash
#zsh
Manual
Using makefile:
or use cargo for debug version:
a simple cargo-make file is included.
Usage
Basic Usage
# Process an image file
# Auto-detect current Hyprland wallpaper
Command-Line Options
<INPUT_IMAGE> Path
)
Examples
pallettes: vibrant, pastel, mono, dark, light , custom colors <int>
# Extract 6 colors instead of default 4 <colors> Uint
# Set custom output directory
# Force regeneration (ignore cache) (not recommended caching engine here is smart! and reliable)
# Generate thumbnails and hash-based dcol files (compatible with wallbash scripts)
# ADVANCED Custom color curve (9 points of brightness and saturation)
Output Files
Wallrust generates these files in the output directory:
wallrust.dcol: Shell variables with color valueswallrust.css: CSS color variableswallrust.json: Palette data in JSON format- Custom template outputs (if templates exist)
When using the --wallset flag, additional files are generated:
- Thumbnail in
~/.cache/wallrust/thumbs/{hash}.thmb - Hash-based dcol file in
~/.cache/wallrust/dcols/{hash}.dcol
Output Directory
- Default:
~/.cache/wallrust/ - Custom: Specified with
--output-dir - Thumbnails and hash-based dcol files:
~/.cache/wallrust/thumbs/and~/.cache/wallrust/dcols/
Custom Templates
Create template files in ~/.config/wallrust/templates/ using Tera syntax. Available template variables:
mode - "dark" or "light"
wallpaper - Path to wallpaper
primary - Array of primary hex colors
text - Array of text hex colors
accents - 2D array of accent hex colors by primary index
primary_rgba - RGBA versions of primary colors
text_rgba - RGBA versions of text colors
accents_rgba - RGBA versions of accent colors
Color Profiles
- default: Balanced colors with moderate saturation
- vibrant: High saturation, vivid colors
- pastel: Soft, muted colors with lower saturation
- mono: Grayscale palette
Wallset Mode
The --wallset flag enables a mode that works similarly to the wallbash scripts:
- Thumbnail Generation: Creates a smaller thumbnail image optimized for color extraction
- Consistent File Naming: Uses SHA256 hashing of the image path for consistent file names
- Directory Structure: Organizes files in a way compatible with theme-switching scripts
This mode is ideal when:
- You need consistent color extraction between Wallrust and wallbash scripts
- You want optimized performance for large image files
- You're integrating with other tools that expect this specific format
Example with all options:
Requirements
- ImageMagick
- Optional: hyprctl (for Hyprland wallpaper detection)