Created
February 22, 2017 08:05
-
-
Save laanwj/3c8c116fc763a149842a07070ca4d6cd to your computer and use it in GitHub Desktop.
Generate debian/ubuntu prompt with random xterm256 colors
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
# Try colors for Ubuntu prompt | |
# . prompt_test.sh 123 125 | |
if [ ! -z "$1" ] && [ ! -z "$2" ]; then | |
COLOR1=$1 | |
COLOR2=$2 | |
else | |
COLOR1=$((($RANDOM%240)+16)) | |
COLOR2=$((($RANDOM%240)+16)) | |
echo "Choosing random colors ${COLOR1} and ${COLOR2}" | |
fi | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[38;5;${COLOR1}m\]\u@\h\[\033[00m\]:\[\033[38;5;${COLOR2}m\]\w\[\033[00m\]\$ ' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment