dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

commit 9227d8e13895c37e9e07da00e40c11096d6aa022
parent 112f82fc1dfc237a75b904adf0277c36ec3a6d29
Author: Dionysis Grigoropoulos <info@erethon.com>
Date:   Fri, 29 May 2015 03:41:13 +0300

bashrc: Change PS1 colors according to UID

Diffstat:
.bashrc | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.bashrc b/.bashrc @@ -110,7 +110,13 @@ parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/' } -export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\[\033[36m\]$(parse_git_branch)\[\033[00m\]\$ ' +if [ $(id -u) == 0 ]; then + prompt_color="\[\033[35m\]" +else + prompt_color="\[\033[32m\]" +fi + +export PS1=$prompt_color"\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\[\033[36m\]$(parse_git_branch)\[\033[00m\]\$ " if [ -f /etc/bash_completion ]; then . /etc/bash_completion