Ok.. So I decided to customize the xfce terminal on one of my machines (Xubuntu). I have been setting up text colors in .bashrc, but I am having a bit of a hard time setting it up so that when I do
or log in as root, to set the text color to what I want... I actually started with the .bashrc from MX Linux because I liked the colors in xfce4-terminal it uses. It works fine, except for this one thing... the section of the code is as follows:
Here's the funny thing.. I can replace
with any other user id number and it works. But when it is looking to see if the user is root, it does not... Anyone got any idea why, or better yet a better alternative to look for? I've tried
etc.. I haven't been able to figure it out.
Code:
sudo su
Code:
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
yellow='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
PURPLE='\[\e[1;35m\]'
purple='\[\e[0;35m\]'
nc='\[\e[0m\]'
if [ "$UID" = 0 ]; then
PS1="$red\u$nc@$red\H$nc:$CYAN\w$nc\\n$red#$nc "
else
PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc "
fi
Here's the funny thing.. I can replace
Code:
"$UID" = 0
Code:
$EUID
Code:
id -u