aboutsummaryrefslogtreecommitdiff
path: root/.bash_profile
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-04-05 22:53:51 -0400
committertdro <tdro@users.noreply.github.com>2020-04-05 22:53:51 -0400
commit800b5b45c46b12891adfa091042f5c00c8873a31 (patch)
treebd80026c6203dafba55787ce77a996a36a93fd0f /.bash_profile
parent6d649e52ca7d7b983dc8fa87c598b8b641d4ae40 (diff)
downloaddotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.tar.gz
dotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.tar.bz2
dotfiles-800b5b45c46b12891adfa091042f5c00c8873a31.zip
.bashrc: Move prompts to profile
Diffstat (limited to '.bash_profile')
-rw-r--r--.bash_profile10
1 files changed, 9 insertions, 1 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"