Files
hyprduma-config/PYWAL-SETUP.md
T

248 lines
5.8 KiB
Markdown
Raw Normal View History

2026-02-12 00:24:50 +04:00
# Pywal Integration Guide
2026-02-12 00:24:50 +04:00
Dynamic color theming based on your wallpaper, applied system-wide to Hyprland, Caelestia, Kitty, GTK apps, Firefox, and more.
## Prerequisites
2026-02-12 00:24:50 +04:00
- `python-pywal` installed (`sudo pacman -S python-pywal`)
- Hyprland window manager
- Caelestia shell (optional, for full integration)
2026-02-12 00:24:50 +04:00
## Setup
2026-02-12 00:24:50 +04:00
If you used the auto-installer (`install.py`), pywal is already configured. For manual setup:
2026-02-12 00:24:50 +04:00
### 1. Install Templates
```bash
mkdir -p ~/.config/wal/templates
cp -r wal/templates/* ~/.config/wal/templates/
2026-02-12 00:24:50 +04:00
# Verify
ls ~/.config/wal/templates/
# Should show: hyprland-colors.conf, caelestia-scheme.json
```
2026-02-12 00:24:50 +04:00
### 2. Install Scripts
```bash
cp pywal.sh ~/.config/hypr/
cp pywal.sh ~/pywal.sh
2026-02-12 00:24:50 +04:00
chmod +x ~/.config/hypr/pywal.sh ~/pywal.sh
```
2026-02-12 00:24:50 +04:00
### 3. Configure Kitty Terminal
```bash
mkdir -p ~/.config/kitty
cp kitty/kitty.conf ~/.config/kitty/
2026-02-12 00:24:50 +04:00
# Verify correct filename reference
grep "colors-kitty" ~/.config/kitty/kitty.conf
# Should show: include ~/.cache/wal/colors-kitty.conf
```
2026-02-12 00:24:50 +04:00
### 4. Configure Shell
2026-02-12 00:24:50 +04:00
Add to `~/.bashrc` (or `~/.zshrc`):
```bash
# Import pywal colorscheme from cache
(cat ~/.cache/wal/sequences &)
# To add support for TTYs (optional)
source ~/.cache/wal/colors-tty.sh 2>/dev/null
2026-02-12 00:24:50 +04:00
```
2026-02-12 00:24:50 +04:00
### 5. Generate Initial Colors
```bash
wal -i wallpapers/sakura.jpg && ~/pywal.sh
source ~/.bashrc
```
2026-02-12 00:24:50 +04:00
## Usage
2026-02-12 00:24:50 +04:00
### Using Waypaper GUI (Recommended)
2026-02-12 00:24:50 +04:00
Press `Super+W` to open waypaper. Select a wallpaper and colors auto-apply via the waypaper hook.
2026-02-12 00:24:50 +04:00
### Command Line
```bash
2026-02-12 00:24:50 +04:00
# Dark theme (default)
~/pywal.sh ~/Pictures/wallpaper.jpg
2026-02-12 00:24:50 +04:00
# Light theme
~/pywal.sh ~/Pictures/wallpaper.jpg light
2026-02-12 00:24:50 +04:00
# Switch mode (keep current wallpaper)
~/pywal.sh "" light
~/pywal.sh "" dark
2026-02-12 00:24:50 +04:00
# Refresh current theme
~/pywal.sh
```
2026-02-12 00:24:50 +04:00
### One-Liner
2026-02-12 00:24:50 +04:00
```bash
wal -i /path/to/wallpaper.png && ~/pywal.sh
```
2026-02-12 00:24:50 +04:00
## Light/Dark Theme
2026-02-12 00:24:50 +04:00
### Light Theme
2026-02-12 00:24:50 +04:00
Works best with bright wallpapers:
2026-02-12 00:24:50 +04:00
```bash
wal -i /path/to/bright-wallpaper.png -l && ~/pywal.sh
```
2026-02-12 00:24:50 +04:00
### Dark Theme (Default)
```bash
2026-02-12 00:24:50 +04:00
wal -i /path/to/dark-wallpaper.png && ~/pywal.sh
```
2026-02-12 00:24:50 +04:00
### Backend Options
Different backends generate different color palettes:
```bash
2026-02-12 00:24:50 +04:00
wal -i /path/to/wallpaper.png --backend colorz # More vibrant
wal -i /path/to/wallpaper.png --backend colorthief # Alternative palette
wal -i /path/to/wallpaper.png --backend haishoku # Another option
```
## What Gets Themed
2026-02-12 00:24:50 +04:00
| Component | What changes |
|-----------|-------------|
| **Hyprland** | Window borders (active gradient, inactive) |
| **Caelestia Shell** | Material Design 3 color scheme, all UI elements |
| **Kitty Terminal** | Background, foreground, all 16 colors |
| **Bash/Zsh Shell** | Terminal color palette via sequences |
| **GTK Apps** | Via `wal-gtk` (if installed) |
| **Firefox** | Via `pywalfox` (if installed) |
| **System** | Dark/light mode preference via gsettings |
2026-02-12 00:24:50 +04:00
## Optional Enhancements
2026-02-12 00:24:50 +04:00
### GTK Theme Support
2026-02-12 00:24:50 +04:00
```bash
yay -S wal-gtk-theme-git
# pywal.sh will automatically generate GTK themes
```
2026-02-12 00:24:50 +04:00
### Firefox Theme Support
2026-02-12 00:24:50 +04:00
```bash
yay -S python-pywalfox
pywalfox install
# Then install the Pywalfox extension from Firefox Add-ons
```
2026-02-12 00:24:50 +04:00
### Qt Application Support
```bash
yay -S qt5ct qt6ct kvantum
echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ~/.config/environment.d/qt.conf
echo "QT_STYLE_OVERRIDE=kvantum" >> ~/.config/environment.d/qt.conf
```
## Customization
2026-02-12 00:24:50 +04:00
### Border Colors
Edit `~/.config/wal/templates/hyprland-colors.conf`:
```conf
general {
2026-02-12 00:24:50 +04:00
col.active_border = rgba({color4.strip}ee) rgba({color6.strip}ee) 45deg
col.inactive_border = rgba({color8.strip}aa)
}
```
2026-02-12 00:24:50 +04:00
Available variables: `{color0}` through `{color15}`, `{background}`, `{foreground}`, `{cursor}`
2026-02-12 00:24:50 +04:00
After editing, regenerate with `wal -R`.
2026-02-12 00:24:50 +04:00
### Caelestia Colors
2026-02-12 00:24:50 +04:00
Edit `~/.config/wal/templates/caelestia-scheme.json` to adjust Material Design 3 color mappings.
2026-02-12 00:24:50 +04:00
## How It Works
2026-02-12 00:24:50 +04:00
1. `wal -i wallpaper.png` generates colors and processes templates in `~/.config/wal/templates/`
2. Generated files land in `~/.cache/wal/`
3. `hyprland.conf` sources `~/.cache/wal/hyprland-colors.conf` for border colors
4. `pywal.sh` copies the Caelestia scheme, reloads Hyprland, restarts Caelestia, reloads Kitty, and sets GTK/Firefox themes
5. The waypaper hook (`waypaper-hook.sh`) runs this entire chain automatically on wallpaper change
2026-02-12 00:24:50 +04:00
## Files
```
2026-02-12 00:24:50 +04:00
~/.config/wal/templates/
├── hyprland-colors.conf # Template for Hyprland border colors
└── caelestia-scheme.json # Template for Caelestia color scheme
2026-02-12 00:24:50 +04:00
~/.cache/wal/ # Generated by pywal
├── hyprland-colors.conf # Sourced by hyprland.conf
├── colors-kitty.conf # Included by kitty.conf
├── caelestia-scheme.json # Copied to Caelestia state dir
├── sequences # Loaded by bashrc
└── colors.json # Full color palette
```
## Troubleshooting
2026-02-12 00:24:50 +04:00
### Colors not applying to terminals
2026-02-12 00:24:50 +04:00
1. Check bashrc has pywal lines: `grep pywal ~/.bashrc`
2. Check cache exists: `ls ~/.cache/wal/sequences`
3. Open a **new** terminal (existing ones need `source ~/.bashrc`)
2026-02-12 00:24:50 +04:00
### Kitty colors wrong
```bash
2026-02-12 00:24:50 +04:00
# Must reference colors-kitty.conf (not kitty-colors.conf)
grep "wal" ~/.config/kitty/kitty.conf
2026-02-12 00:24:50 +04:00
# Fix if wrong
sed -i 's/kitty-colors.conf/colors-kitty.conf/g' ~/.config/kitty/kitty.conf
2026-02-12 00:24:50 +04:00
killall -SIGUSR1 kitty
```
2026-02-12 00:24:50 +04:00
### Caelestia not updating
```bash
pkill caelestia && sleep 0.5 && caelestia shell -d &
```
### Hyprland fails to start (source file not found)
2026-02-12 00:24:50 +04:00
Run `wal -i /path/to/wallpaper.png` once to generate initial colors before starting Hyprland.
### Complete Reset
```bash
rm -rf ~/.cache/wal
mkdir -p ~/.config/wal/templates
cp ~/.config/hypr/wal/templates/* ~/.config/wal/templates/
2026-02-12 00:24:50 +04:00
wal -i /path/to/wallpaper.png && ~/pywal.sh
source ~/.bashrc
```
2026-02-12 00:24:50 +04:00
### Kitty Opacity for Light Themes
2026-02-12 00:24:50 +04:00
If light theme is too transparent, adjust in `~/.config/kitty/kitty.conf`:
2026-02-12 00:24:50 +04:00
```conf
background_opacity 0.95
```
2026-02-12 00:24:50 +04:00
Reload: `killall -SIGUSR1 kitty`