Skip to content

Commit a1e2557

Browse files
committed
feat: Updating ps1
Signed-off-by: Vincent Boutour <[email protected]>
1 parent 8999215 commit a1e2557

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sources/ps1.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
export PROMPT_DIRTRIM="3"
44

5-
PS1="${BLUE}\u${RESET}"
5+
PS1=""
6+
7+
# Show username if different than logname
8+
if [[ $(logname) != "$(id -un)" ]]; then
9+
PS1+="${BLUE}\u${RESET}"
10+
fi
611

712
# Show hostname if SSH
813
if [[ -n ${SSH_CONNECTION:-} ]]; then
@@ -11,9 +16,9 @@ fi
1116

1217
PS1+=" "
1318

14-
# Show red star if root
19+
# Show red star if root (most likely root has a different PS1)
1520
if [[ $UID -eq 0 ]]; then
16-
PS1+="${RED}👻${RESET} "
21+
PS1+="${PURPLE}👻${RESET} "
1722
fi
1823

1924
PS1+="${GREEN}\w${RESET}"

0 commit comments

Comments
 (0)