Add zsh/lolcat.zsh rainbow helpers + document in README

This commit is contained in:
2026-06-24 09:12:17 -07:00
parent 2906352220
commit 4053acbbc0
2 changed files with 70 additions and 0 deletions
+39
View File
@@ -102,6 +102,45 @@ On top of stock YADR:
- Misc: `.rainbow_config.json` (rainbowstream), `.nanorc`, `.selected_editor`,
`.mplayer/config`, `.jigdo-lite`
## Rainbow output (lolcat)
`zsh/lolcat.zsh` wires [lolcat](https://github.com/jaseg/lolcat) (Debian's
`/usr/games/lolcat`, the truecolor C build) into a few shell helpers. lolcat
auto-detects a tty — it colorizes straight to the terminal but passes text
through plain when piped onward, so use `-f`/`--force` to colorize mid-pipeline.
### Opt-in, per command
Prefix any command to rainbow its output:
```sh
lol fastfetch
lol git log --oneline
lol ls -C # -C keeps columns: a piped ls otherwise goes single-column
lolf git diff | less -R # force color so it survives down a pipeline
```
### Shortcuts
```sh
rcat file.txt # rainbow cat
rls -la # rainbow ls, columns preserved
some-cmd | rless # rainbow + pager (less -R)
```
### Session toggle
Rainbow *all* shell stdout until you turn it off:
```sh
rainbow_on # everything is rainbow now
...
rainbow_off # back to normal
```
Novelty only: it garbles full-screen/interactive programs (vim, less, htop,
fzf, ssh) and the prompt, and buffers streaming output. Doesn't touch stderr.
## Upstream
Base is [skwp/dotfiles][yadr] (YADR — Yet Another Dotfiles Repo). All credit