Created
March 28, 2018 13:00
-
-
Save chrissound/93d0815231ff9102f82b2b2ce7dbe58f to your computer and use it in GitHub Desktop.
zsh oh my zsh random colour per terminal
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
prompt_randomCol() { | |
if [[ -z "${PROMPTRANDOMCOL1-}" ]]; then | |
PROMPTRANDOMCOL1=$(($RANDOM % 256)) | |
PROMPTRANDOMCOL2=$(($RANDOM % 256)) | |
PROMPTRANDOMCOL3=$(($RANDOM % 256)) | |
PROMPTRANDOMCOL4=$(($RANDOM % 256)) | |
randsh=$(($RANDOM % 4)) | |
if [ "$randsh" = "0" ]; then | |
PROMPTRANDOMSHAPE1="\ue0b0" | |
else | |
PROMPTRANDOMSHAPE1="\u25cf" | |
fi | |
randsh=$(($RANDOM % 2)) | |
if [ "$randsh" = "0" ]; then | |
PROMPTRANDOMSHAPE2="\ue0b0" | |
else | |
PROMPTRANDOMSHAPE2="\u25cf" | |
fi | |
fi | |
prompt_segment $PROMPTRANDOMCOL1 $PROMPTRANDOMCOL2 $PROMPTRANDOMSHAPE1 | |
prompt_segment $PROMPTRANDOMCOL3 $PROMPTRANDOMCOL4 $PROMPTRANDOMSHAPE2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment