aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_profile10
-rw-r--r--.bashrc12
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"
diff --git a/.bashrc b/.bashrc
index 53e9f49..30b0a0a 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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 '';