Skip to content

Commit

Permalink
$PS1 if root=red other=yellow
Browse files Browse the repository at this point in the history
  • Loading branch information
parsapoorsh committed May 27, 2024
1 parent 5c13055 commit 47d02a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ if [ "$color_prompt" = yes ]; then
SC_CYAN="$(tput setaf 6)"
SC_WHITE="$(tput setaf 7)"

PS1='${debian_chroot:+($debian_chroot)}\[$SC_BOLD$SC_GREEN\]\u@\h\[$SC_COLOR_OFF\]:\[$SC_BOLD$SC_BLUE\]\w\[$SC_COLOR_OFF\]\$ '
if [ "$(id -u)" -eq 0 ]; then # If root user
PS1_COLOR1="$SC_RED"
else
PS1_COLOR1="$SC_YELLOW"
fi
PS1='${debian_chroot:+($debian_chroot)}\[$SC_BOLD$PS1_COLOR1\]\u@\h\[$SC_COLOR_OFF\]:\[$SC_BOLD$SC_BLUE\]\w\[$SC_COLOR_OFF\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
Expand Down

0 comments on commit 47d02a9

Please sign in to comment.