Skip to content

Instantly share code, notes, and snippets.

@KorvinSilver
Last active March 5, 2018 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KorvinSilver/bd9f6231771d39fd26a2a00c40fb4c72 to your computer and use it in GitHub Desktop.
Save KorvinSilver/bd9f6231771d39fd26a2a00c40fb4c72 to your computer and use it in GitHub Desktop.
Bashrc with custom colorized prompt (blokkzh)
export SAL_USE_VCLPLUGIN=gen
# Set color options
restore="\[\033[00m\]"
yellow="\[\033[33m\]"
cyan="\[\033[36m\]"
blueBold="\[\033[01;34m\]"
white="\[\033[37m\]"
redBold="\[\033[01;31m\]"
# Update PS1 with previous exit code if it wasn't zero
RET="\$(code=\$? && [[ \$code != 0 ]] && echo \"[$redBold\$code$restore]─\")"
# Set what's drawn before and after the prompt
prefix="┌─"
suffix="\n└─➤ "
suffixRoot="\n└─$redBold➤$restore "
# Set up prompt
if [ $UID -ne 0 ] # normal user
then
PS1="$prefix$RET[$yellow\u$white@$cyan\h$restore]─[$yellow"bash"$restore]─[$blueBold\w$restore]"$suffix""
else # root
PS1="$prefix$RET[$redBold\h$restore]─[$yellow"bash"$restore]─[$blueBold\w$restore]"$suffixRoot""
fi
# Use this other PS1 string if you want \W for root and \w for all other users:
alias ls="ls --color=auto"
alias dir="dir --color=auto"
alias grep="grep --color=auto"
alias dmesg='dmesg --color'
. /etc/profile.d/vte.sh
@KorvinSilver
Copy link
Author

Based on my blokkzh ZSH theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment