This file contains 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
lolps1() { | |
PREV_EXIT_CODE=$? | |
# PS1 rainbow modified from https://gist.github.com/duckythescientist/8338f028e018fd3fecae58e4f1c45def | |
# Replace $HOME with ~ | |
mypwd=${PWD/#$HOME/"~"} | |
# Make a persistent, incrementing seed to make a smooth rainbow effect from line to line | |
if [ -z ${LOLCAT_SEED+x} ]; then LOLCAT_SEED=1; else let "LOLCAT_SEED += 1"; fi | |
PS1=$(echo " $mypwd" | lolcat --force --freq 0.3 --seed $LOLCAT_SEED 2>/dev/null) | |
# Strip the "reset colors to normal" commands | |
PS1=$(echo "$PS1" | sed $'s/\033\[0m//g') |