Add colorful prompt

This commit is contained in:
Daniel A. Maierhofer
2018-03-27 17:58:00 +02:00
parent 4276d2c1fe
commit 230a0a60bf

View File

@@ -63,7 +63,9 @@ if [ -n "$force_color_prompt" ]; then
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \$ '
color_prompt_cols=('1;35' '0;32' '0;33' '0;34' '0;35' '0;36' '0;37' '1;31' '1;32' '1;33' '1;34' '0;31' '1;36' '1;37')
color_prompt_col='\[\e[${color_prompt_cols[$(echo "${HOSTNAME}" | md5sum | sed s/[abcdef]*// | head -c 1)]}m\]'
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@'$color_prompt_col'\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi