XDG Base Directory compliance — all install/config/runtime paths now resolve via $XDG_CONFIG_HOME, $XDG_DATA_HOME, and $XDG_RUNTIME_DIR with the conventional defaults (~/.config, ~/.local/share, /tmp) as fallbacks. BIN_DIR stays ~/.local/bin since no XDG standard covers user binaries.
--uninstall flag — removes the binary symlink, .desktop entry, and data directory with colored per-step output and a post-run verification pass. Prompts to remove the config directory when stdin is a TTY; skips the prompt (keeps config) in non-interactive mode.
xclip advisory — --check-deps and --install now emit a yellow warning when wl-clipboard is absent but xclip is found, explaining that xclip routes through XWayland and may be unreliable on Wayland.
Dependency message cleanup — normalized all clipboard messages to use package names (wl-clipboard, xclip) consistently.
Readable path output — added tilde_path helper that replaces the $HOME prefix with ~/ in any user-facing path string. Applied throughout --help, --install, and --uninstall output. Paths outside $HOME (e.g. custom XDG roots) are shown as full absolute paths. All actual file operations continue to use the original absolute paths.
README — updated install steps, usage block, and configuration section to reference XDG variables; added xclip advisory to prerequisites; documented --uninstall.
Tests — export XDG_CONFIG_HOME/XDG_DATA_HOME in the sandbox so the overridden HOME is respected (fixes a pre-existing test regression); add cp and ln to mocked tools; add test 15 (install verifies XDG file placement) and test 16 (uninstall verifies cleanup with config kept).
Manual Verification
Run color-tool --help and confirm --uninstall appears, the --install line shows ~/... paths, and the config path at the bottom shows ~/.config/color-tool/config.toml.
With $XDG_CONFIG_HOME and $XDG_DATA_HOMEunset, run --install and confirm all output paths are shown as ~/... and files land in the correct locations.
Set XDG_DATA_HOME=/tmp/test-data XDG_CONFIG_HOME=/tmp/test-cfg, run --install, and confirm output shows the full /tmp/... paths (not ~/...) and files land under those custom locations.
Run --uninstall (after installing) and confirm all step output and the verification table show ~/... paths. Answer N at the config prompt and confirm the config directory is kept.
Run --uninstall again and confirm it exits cleanly, reporting each missing item as "not found — skipping".
Run --check-deps on a system where xclip is installed but wl-clipboard is not, and confirm the yellow └─ xclip found but wl-clipboard is missing advisory appears.
Run ./tests/run_tests.sh and confirm all 16 tests pass.
## Summary
- **XDG Base Directory compliance** — all install/config/runtime paths now resolve via `$XDG_CONFIG_HOME`, `$XDG_DATA_HOME`, and `$XDG_RUNTIME_DIR` with the conventional defaults (`~/.config`, `~/.local/share`, `/tmp`) as fallbacks. `BIN_DIR` stays `~/.local/bin` since no XDG standard covers user binaries.
- **`--uninstall` flag** — removes the binary symlink, `.desktop` entry, and data directory with colored per-step output and a post-run verification pass. Prompts to remove the config directory when stdin is a TTY; skips the prompt (keeps config) in non-interactive mode.
- **xclip advisory** — `--check-deps` and `--install` now emit a yellow warning when `wl-clipboard` is absent but `xclip` is found, explaining that xclip routes through XWayland and may be unreliable on Wayland.
- **Dependency message cleanup** — normalized all clipboard messages to use package names (`wl-clipboard`, `xclip`) consistently.
- **Readable path output** — added `tilde_path` helper that replaces the `$HOME` prefix with `~/` in any user-facing path string. Applied throughout `--help`, `--install`, and `--uninstall` output. Paths outside `$HOME` (e.g. custom XDG roots) are shown as full absolute paths. All actual file operations continue to use the original absolute paths.
- **README** — updated install steps, usage block, and configuration section to reference XDG variables; added xclip advisory to prerequisites; documented `--uninstall`.
- **Tests** — export `XDG_CONFIG_HOME`/`XDG_DATA_HOME` in the sandbox so the overridden `HOME` is respected (fixes a pre-existing test regression); add `cp` and `ln` to mocked tools; add test 15 (install verifies XDG file placement) and test 16 (uninstall verifies cleanup with config kept).
## Manual Verification
- [x] Run `color-tool --help` and confirm `--uninstall` appears, the `--install` line shows `~/...` paths, and the config path at the bottom shows `~/.config/color-tool/config.toml`.
- [x] With `$XDG_CONFIG_HOME` and `$XDG_DATA_HOME` **unset**, run `--install` and confirm all output paths are shown as `~/...` and files land in the correct locations.
- [x] Set `XDG_DATA_HOME=/tmp/test-data XDG_CONFIG_HOME=/tmp/test-cfg`, run `--install`, and confirm output shows the full `/tmp/...` paths (not `~/...`) and files land under those custom locations.
- [x] Run `--uninstall` (after installing) and confirm all step output and the verification table show `~/...` paths. Answer **N** at the config prompt and confirm the config directory is kept.
- [x] Run `--uninstall` again and confirm it exits cleanly, reporting each missing item as "not found — skipping".
- [x] Run `--check-deps` on a system where `xclip` is installed but `wl-clipboard` is not, and confirm the yellow `└─ xclip found but wl-clipboard is missing` advisory appears.
- [x] Run `./tests/run_tests.sh` and confirm all 16 tests pass.
- Resolve all paths via $XDG_CONFIG_HOME, $XDG_DATA_HOME, and
$XDG_RUNTIME_DIR with conventional fallbacks (~/.config,
~/.local/share, /tmp); BIN_DIR stays ~/.local/bin (no XDG standard)
- Add --uninstall: removes symlink, desktop entry, and data dir with
colored per-step output; prompts to remove config when interactive,
skips silently when not; post-run verification reports any failures
- Warn in --check-deps and --install when only xclip is present —
xclip operates through XWayland and can be unreliable on Wayland
- Normalize dependency messages to package names (wl-clipboard, xclip)
- Update README: XDG paths in install steps, --uninstall in usage,
xclip advisory in prerequisites
- Fix test sandbox: export XDG_CONFIG_HOME and XDG_DATA_HOME so the
overridden HOME is respected; add install (test 15) and uninstall
(test 16) coverage; add cp and ln to mocked tool set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Show only the binary(s) actually present in the clipboard row label,
and use a yellow ✔ (instead of green) when only xclip is found so the
degraded state stands out from a fully-satisfied check.
--uninstall prompts for config removal when stdin is a TTY. Running the
test from an interactive terminal caused it to block on read. Feeding
/dev/null forces the non-interactive path without changing behaviour.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
$XDG_CONFIG_HOME,$XDG_DATA_HOME, and$XDG_RUNTIME_DIRwith the conventional defaults (~/.config,~/.local/share,/tmp) as fallbacks.BIN_DIRstays~/.local/binsince no XDG standard covers user binaries.--uninstallflag — removes the binary symlink,.desktopentry, and data directory with colored per-step output and a post-run verification pass. Prompts to remove the config directory when stdin is a TTY; skips the prompt (keeps config) in non-interactive mode.--check-depsand--installnow emit a yellow warning whenwl-clipboardis absent butxclipis found, explaining that xclip routes through XWayland and may be unreliable on Wayland.wl-clipboard,xclip) consistently.tilde_pathhelper that replaces the$HOMEprefix with~/in any user-facing path string. Applied throughout--help,--install, and--uninstalloutput. Paths outside$HOME(e.g. custom XDG roots) are shown as full absolute paths. All actual file operations continue to use the original absolute paths.--uninstall.XDG_CONFIG_HOME/XDG_DATA_HOMEin the sandbox so the overriddenHOMEis respected (fixes a pre-existing test regression); addcpandlnto mocked tools; add test 15 (install verifies XDG file placement) and test 16 (uninstall verifies cleanup with config kept).Manual Verification
color-tool --helpand confirm--uninstallappears, the--installline shows~/...paths, and the config path at the bottom shows~/.config/color-tool/config.toml.$XDG_CONFIG_HOMEand$XDG_DATA_HOMEunset, run--installand confirm all output paths are shown as~/...and files land in the correct locations.XDG_DATA_HOME=/tmp/test-data XDG_CONFIG_HOME=/tmp/test-cfg, run--install, and confirm output shows the full/tmp/...paths (not~/...) and files land under those custom locations.--uninstall(after installing) and confirm all step output and the verification table show~/...paths. Answer N at the config prompt and confirm the config directory is kept.--uninstallagain and confirm it exits cleanly, reporting each missing item as "not found — skipping".--check-depson a system wherexclipis installed butwl-clipboardis not, and confirm the yellow└─ xclip found but wl-clipboard is missingadvisory appears../tests/run_tests.shand confirm all 16 tests pass.9ff6a58814to06dd84d3a3