Last active
March 5, 2018 00:07
-
-
Save KorvinSilver/bd9f6231771d39fd26a2a00c40fb4c72 to your computer and use it in GitHub Desktop.
Bashrc with custom colorized prompt (blokkzh)
This file contains hidden or 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on my blokkzh ZSH theme.