Created
June 12, 2026 20:01
-
-
Save fabd/072515c589879b6b79d0e878c79aa11d to your computer and use it in GitHub Desktop.
No-dependencies lolcat equivalent for use in Windows + Git Bash (meow is really slow!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add to your .bash_profile | |
| lolcat() { | |
| awk -v seed="$RANDOM" ' | |
| BEGIN { | |
| PI = 3.14159 | |
| f = 0.04 # <-- DECREASE to stretch the wave | |
| p1 = 0; p2 = 2 * PI / 3; p3 = 4 * PI / 3 | |
| line_idx = seed # <--- Starts at a totally random spot in the rainbow | |
| } | |
| { | |
| for (i = 1; i <= length($0); i++) { | |
| c = substr($0, i, 1) | |
| idx = line_idx + (i * 0.4) # <-- DECREASE for wider horizontal spread | |
| r = int(sin(f * idx + p1) * 127 + 128) | |
| g = int(sin(f * idx + p2) * 127 + 128) | |
| b = int(sin(f * idx + p3) * 127 + 128) | |
| printf "\033[38;2;%d;%d;%dm%s", r, g, b, c | |
| } | |
| printf "\033[0m\n" | |
| line_idx += 1.5 # <-- Optional: Controls vertical tilt (lower = more horizontal) | |
| }' "$@" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment