diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index 4363692..b257f19 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -23,7 +23,7 @@ shopt -s checkwinsize [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # some more ls aliases alias lsa='ls -lah' @@ -59,7 +59,15 @@ set_exit_code() { set_prompt() { PS1_BAT="$(bash-status-bat)" PS1_GIT="$(bash-status-git)" - PS1L="\[\033[00;32m\]\u\[\033[00;34m\]@\[\033[01;32m\]\h \[\033[00m\]\$PS1_BAT \[\033[00;36m\]\w\[\033[00m\] $PS1_GIT" + + dir_perm=$(ls -ld | awk '{ print $3 }') + if [[ "$dir_perm" == "$USER" ]]; then + dir="\[\033[00;36m\]\w" + else + dir="\[\033[00;31m\]\w" + fi + + PS1L="\[\033[00;32m\]\u\[\033[00;34m\]@\[\033[01;32m\]\h \[\033[00m\]\$PS1_BAT $dir\[\033[00m\] $PS1_GIT" PS1R=$(date +"%R:%S") PS1=$(printf "%*s\r%s\n\[\033[00m\]\$(set_exit_code)-[ " "$(tput cols)" "$PS1R" "$PS1L") }