diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-16 09:44:26 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-16 09:44:26 +0200 |
| commit | 845e6d3f393811bdc78833c9457d9768e685e572 (patch) | |
| tree | d8adbb5631936c55e95da08405a130b4525cf698 /README.md | |
| parent | da1f0761e8a902b68134cdd9ec5eac3c549a9fcb (diff) | |
| download | wallp-845e6d3f393811bdc78833c9457d9768e685e572.tar.gz wallp-845e6d3f393811bdc78833c9457d9768e685e572.zip | |
wallp no longer owns a colour theme. The --theme flag, the THEME config
key, the persisted ~/.config/wallp/theme file and the wal invocation are
gone; finalize now writes ~/.cache/udt/wpaper and hands it to udt-accent,
which owns the whole palette (rofi, Hyprland, Firefox, quickshell,
Sublime). That call is best-effort: a missing or failing udt-accent must
never stop a wallpaper from being set, so wal is also dropped from the
required-binary check.
Tests follow the same shape: the theme-resolution and apply_theme cases
are removed, the wal stub is replaced by udt-accent, and two new cases
cover finalize calling udt-accent on the symlink and surviving its
failure.
Docs updated to match, including the install method: ~/bin/wallp is now
a symlink to the checkout rather than a copy, so repo edits no longer
need a manual re-copy to reach the live desktop.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 67 |
1 files changed, 25 insertions, 42 deletions
@@ -1,8 +1,8 @@ # wallp A single-script wallpaper manager for a two-screen Wayland (sway / Hyprland) -setup. Sets and restores wallpapers per screen, drives a [pywal](https://github.com/dylanaraps/pywal) -color theme, and remembers what you had across reboots. +setup. Sets and restores wallpapers per screen, refreshes the desktop accent +colour to match, and remembers what you had across reboots. It replaces two older scripts — an interactive setter and a session restorer — with one flag-driven program. @@ -16,10 +16,11 @@ with one flag-driven program. restarted (no full-screen blank flash). - **GUI or CLI** — pick wallpapers through a [qarma](https://github.com/luebking/qarma) dialog, or pass file paths as arguments for scripted/headless use. -- **Session restore** — re-applies the last wallpapers (and last theme) at login, - falling back to configured defaults on first run. -- **Theme persistence** — the last theme sticks until you change it; `--restore` - brings it back, not the config default. +- **Session restore** — re-applies the last wallpapers at login, falling back to + configured defaults on first run. +- **Unified desktop theme** — after every change `wallp` hands the new wallpaper + to `udt-accent`, which owns the whole palette (rofi, Hyprland, Firefox, + quickshell, Sublime). `wallp` itself no longer runs pywal or stores a theme. - **Self-bootstrapping config** — first run writes a template config and tells you to fill it in, without touching your wallpapers. @@ -29,25 +30,26 @@ with one flag-driven program. |---------------|---------------------|--------------------------------------| | `bash` | yes (≥ 4.4) | the script itself | | `swaybg` | yes | paints the wallpaper on each output | -| `wal` (pywal) | yes | generates/applies the color theme | +| `udt-accent` | optional | refreshes the desktop accent colour | | `qarma` | only for GUI `--set`| screen-choice menu + file picker | -| `notify-send` | optional | desktop notification on theme change | | `bats` | dev only | running the test suite | `wallp` checks for the required binaries at startup and exits with a clear -message if one is missing. +message if one is missing. `udt-accent` is looked up at run time: if it is +absent, or it fails, the wallpaper is still set and only the accent refresh is +skipped. ## Install `wallp` is a standalone script — put it somewhere on your `PATH`: ```bash -cp wallp ~/bin/wallp -chmod +x ~/bin/wallp +ln -s "$PWD/wallp" ~/bin/wallp ``` -> **Note:** this is a plain copy. If you later edit the script in the repo, -> re-copy it to `~/bin` for the change to take effect. +A symlink keeps the installed command in step with the checkout, so edits take +effect at once. A plain `cp wallp ~/bin/wallp && chmod +x ~/bin/wallp` works too, +but then every repo edit needs a re-copy. ## Configuration @@ -58,9 +60,6 @@ wallpaper** — edit it, then run again. ```ini # ~/.config/wallp/wallp.conf -# Optional. Defaults to sexy-splurge if omitted. -THEME=sexy-splurge - # Physical output names. Find yours with: # swaymsg -t get_outputs (sway) # hyprctl monitors (Hyprland) @@ -79,8 +78,8 @@ Format notes: - Plain `key=value`, one per line. Blank lines and `#` comments are ignored. - The file is **not** sourced as shell — it's parsed manually, so it can't run code. -- `OUTPUT_H`, `OUTPUT_V`, `DEFAULT_H`, `DEFAULT_V` are required. A missing or - empty one is a hard error (named in the message). `THEME` is optional. +- `OUTPUT_H`, `OUTPUT_V`, `DEFAULT_H`, `DEFAULT_V` are all required. A missing + or empty one is a hard error (named in the message). ## Usage @@ -92,7 +91,6 @@ wallp --set H=<file> Set the horizontal screen only wallp --set V=<file> Set the vertical screen only wallp --set H=<f> V=<f> Set both screens wallp --restore Restore last session (defaults if none saved) -wallp --theme <name> Override the theme (combine with --set or --restore) ``` ### Examples @@ -109,22 +107,8 @@ wallp --set H=~/pics/wide.jpg V=~/pics/tall.jpg # Restore on login (defaults on first ever run). wallp --restore - -# Set a wallpaper and switch theme in one go; the theme persists afterwards. -wallp --set H=~/pics/wide.jpg --theme gruvbox ``` -### Theme precedence - -When resolving which theme to apply, `wallp` uses, in order: - -1. `--theme <name>` on the command line, -2. the last persisted theme (`~/.config/wallp/theme`), -3. `THEME` from the config, -4. the built-in default `sexy-splurge`. - -The resolved theme is always saved, so it carries across `--restore`. - ### GUI vs CLI `qarma` is used **only** to draw windows — the screen-choice menu, the file @@ -145,21 +129,20 @@ State is owned entirely by `wallp`: | `~/.config/wallp/wallp.conf` | configuration | | `~/.config/wallp/wall_h` | persisted horizontal wallpaper path | | `~/.config/wallp/wall_v` | persisted vertical wallpaper path | -| `~/.config/wallp/theme` | persisted theme name | | `~/.cache/wallp/H.pid` | PID of the horizontal `swaybg` | -| `~/.cache/wallp/V.pid` | PID of the vertical `swaybg` | -| `~/.cache/wal/wpaper` | symlink to the current horizontal image | +| `~/.cache/wallp/V.pid` | PID of the vertical `swaybg` | +| `~/.cache/udt/wpaper` | symlink to the current horizontal image | Setting a screen: validate the file, kill **only** that screen's old `swaybg`, launch a new one (`swaybg -o <output> -i <file> -m fill`), record the new PID, -and save the path. Then update the `wpaper` symlink and apply the theme via -`wal --backend colorz -nq --theme <name> -o ~/bin/wal.sh`. +and save the path. Then update the `~/.cache/udt/wpaper` symlink and run +`udt-accent ~/.cache/udt/wpaper` to re-derive the desktop accent colour. Restoring: for each screen, use the saved path if present, otherwise the -configured default; apply it; then re-apply the resolved (persisted) theme. +configured default; apply it; then refresh the accent the same way. -The `~/.cache/wal/wpaper` symlink is kept because other tools (e.g. rofi themes) -read it. +The `wpaper` symlink is the hand-off point to the rest of the theme: other +tools (rofi, `udt-accent`) read it rather than `wallp`'s own state. ## Integration with sway / Hyprland @@ -184,7 +167,7 @@ so they can be unit-tested. Tests use [bats](https://github.com/bats-core/bats-c bats tests/wallp.bats ``` -The suite stubs `swaybg`, `wal`, `qarma`, and `notify-send` on `PATH` and runs +The suite stubs `swaybg`, `udt-accent`, `qarma`, and `notify-send` on `PATH` and runs against a temporary `$HOME`, so it touches nothing real. Contributions should follow TDD — add a failing test first. |
