diff options
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -7,14 +7,16 @@ Guidance for AI agents working in this repo. `wallp` — a single bash script that sets and restores wallpapers on a fixed two-screen wayland (sway/hyprland) setup. It merges two older scripts (`multiwal.sh` interactive setter, `qar-lastwall.sh` restorer). Uses `swaybg` to -paint wallpapers, `qarma` for GUI selection, `wal` (pywal) for the color theme. +paint wallpapers, `qarma` for GUI selection, and `udt-accent` (the unified +desktop theme tool, outside this repo) to refresh the accent colour from the +wallpaper. `wallp` no longer runs pywal and has no theme of its own. Logical screens are `H` (horizontal) and `V` (vertical), mapped to physical outputs via config (`OUTPUT_H`/`OUTPUT_V`). ## Layout -- `wallp` — the whole program (one bash file, ~320 lines). +- `wallp` — the whole program (one bash file, ~310 lines). - `tests/wallp.bats` — bats test suite (the only tests). - `wallp.conf.example` — sample config. - `docs/superpowers/specs/` — design spec. @@ -29,7 +31,7 @@ bats tests/wallp.bats ``` Requires `bats` (1.5.0 known good). Tests run hermetically: `setup()` creates a -temp `$HOME`, stubs `swaybg`/`wal`/`qarma`/`notify-send`/`pkill`/`kill` on `PATH` +temp `$HOME`, stubs `swaybg`/`udt-accent`/`qarma`/`notify-send`/`pkill`/`kill` on `PATH` (each logs its call to `$HOME/calls.log` and exits 0), then `source`s `wallp`. The sourcing guard at EOF (`[ "${BASH_SOURCE[0]}" = "$0" ]`) keeps `main` from running on source — **do not remove it.** @@ -44,18 +46,18 @@ Syntax check: `bash -n wallp`. the function directly when asserting on globals (`CONF_*`, `SET_*`) or filesystem side effects, since `run` executes in a subshell. - **Pure logic is unit-testable** (conf parse, arg parse, tilde expansion, output - mapping, theme resolution). Side-effecting bits (`swaybg`, `wal`, `qarma`) are - isolated in thin functions and exercised via the PATH stubs. + mapping). Side-effecting bits (`swaybg`, `udt-accent`, `qarma`) are isolated in + thin functions and exercised via the PATH stubs. - `set -u` is on. Empty-array expansion `"${set_args[@]}"` is safe on bash ≥ 4.4 (this host is fine). Guard env vars with `${VAR:-}`. - Quote all paths (wallpaper filenames may contain spaces). ## Critical gotchas -- **Install is a COPY, not a symlink.** The live binary is `~/bin/wallp`, copied - from this repo. After editing repo `wallp`, re-copy: - `cp /home/danix/Programming/GIT/wallp/wallp ~/bin/wallp` - Otherwise hypr autostart/keybind run the stale version. +- **Install is a symlink.** `~/bin/wallp` points at this checkout's `wallp`, so + repo edits are live immediately for the hypr autostart/keybind. No re-copy + step. (It used to be a plain copy, which shipped stale versions.) + Recreate with: `ln -sf "$PWD/wallp" ~/bin/wallp` - **qarma `--list` needs `--radiolist --print-column=2`.** A plain `--list` prints nothing on selection (bug that shipped once). `qarma_select` depends on these flags; a regression test guards it. @@ -71,14 +73,17 @@ Syntax check: `bash -n wallp`. the other — there's a test for this; keep it green. - **`load_conf` return codes:** 0 ok, 1 invalid (missing required key), 10 bootstrapped (template just written → caller exits 0, no wallpaper change). -- **Persistence is wallp-owned**, under `~/.config/wallp/` (`wall_h`, `wall_v`, - `theme`). `~/.cache/wal/wpaper` symlink is still maintained (rofi reads it). - `~/bin/wal.sh` was trimmed to dunst+kitty glue only; it no longer touches - wallpaper pointers. +- **Persistence is wallp-owned**, under `~/.config/wallp/` (`wall_h`, `wall_v`). + `finalize` writes the `~/.cache/udt/wpaper` symlink, then calls + `udt-accent "$HOME/.cache/udt/wpaper"`. That call is never fatal: if the binary + is missing or exits non-zero, the wallpaper still stands. `udt-accent` owns the + whole palette (rofi, Hyprland, Firefox, quickshell, Sublime), so nothing here + renders colours first. ## External integration (outside this repo) -- `~/bin/wal.sh` — wal's `-o` hook; dunst + kitty theming only now. +- `~/bin/udt-accent` — unified desktop theme accent picker; reads + `~/.cache/udt/wpaper`, writes the rest of the palette. - `~/.config/hypr/sections/autostart.lua` → `wallp --restore`. - `~/.config/hypr/sections/keybindings.lua` → `wallp --set` (mainMod+Return). - Old `~/bin/multiwal.sh` + `qar-lastwall.sh` kept as fallback, unreferenced. |
