diff options
author | tdro <tdro@users.noreply.github.com> | 2020-04-05 22:53:51 -0400 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2020-04-05 22:53:51 -0400 |
commit | 800b5b45c46b12891adfa091042f5c00c8873a31 (patch) | |
tree | bd80026c6203dafba55787ce77a996a36a93fd0f | |
parent | 6d649e52ca7d7b983dc8fa87c598b8b641d4ae40 (diff) | |
download | dotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.tar.gz dotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.tar.bz2 dotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.zip |
.bashrc: Move prompts to profile
-rw-r--r-- | .bash_profile | 10 | ||||
-rw-r--r-- | .bashrc | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/.bash_profile b/.bash_profile index b6d9a9f..ea406fd 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,7 +1,15 @@ #!/bin/bash # auto login -[ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] && exec startx >/dev/null 2>&1; +[ "$EUID" -ne 0 ] && [ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] && exec startx >/dev/null 2>&1; + +# set prompt +[ "$EUID" -ne 0 ] && export PS1='\[\e[0;34m\]\W \$\[\e[0m\] '; +[ "$EUID" -eq 0 ] && export PS1='\[\e[1;31m\]\W \$\[\e[0m\] '; + +# ssh set prompt +[ -n "$SSH_CLIENT" ] && [ "$EUID" -ne 0 ] && export PS1='\[\e[1;32m\]\W \$\[\e[0m\] '; +[ -n "$SSH_CLIENT" ] && [ "$EUID" -eq 0 ] && export PS1='\[\e[1;31m\]\W \$\[\e[0m\] '; # path exports export PATH="$PATH:$HOME/.config/composer/vendor/bin" @@ -6,16 +6,6 @@ # bail if not interactive [[ $- != *i* ]] && return; -# set prompt -[[ "$EUID" -ne 0 ]] && PS1='\[\e[0;34m\]\W \$\[\e[0m\] '; -[[ "$EUID" -eq 0 ]] && PS1='\[\e[1;31m\]\W \$\[\e[0m\] '; - -# ssh bash prompt color change -if [ -n "$SSH_CLIENT" ]; then - [[ "$EUID" -ne 0 ]] && export PS1='\[\e[1;32m\]\W \$\[\e[0m\] '; - [[ "$EUID" -eq 0 ]] && export PS1='\[\e[1;31m\]\W \$\[\e[0m\] '; -fi - # cd using directory name shopt -s autocd; @@ -26,7 +16,7 @@ shopt -s histappend; shopt -s cmdhist; # enable vi mode -set -o vi +set -o vi; # disable ctrl+s stty stop ''; |