summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpankunull <panku_null@proton.me>2025-08-24 21:45:18 +0200
committerpankunull <panku_null@proton.me>2025-08-24 21:45:18 +0200
commit1a1192936d899794b23a93698a234f563e200be6 (patch)
treec62954ca30efa901a198fa930501e8ed4850d626 /src
parent5cfc88cc0902817406920c036df48b35a799b571 (diff)
Added user color check for root and others.
Diffstat (limited to 'src')
-rw-r--r--src/.bashrc_ps19
1 files changed, 7 insertions, 2 deletions
diff --git a/src/.bashrc_ps1 b/src/.bashrc_ps1
index 33daa0d..aa4281a 100644
--- a/src/.bashrc_ps1
+++ b/src/.bashrc_ps1
@@ -20,8 +20,13 @@ function update_ps1 {
#local time="\[\033[1;37m\]\t\[\033[0m\]"
# User
- #local user="\[\033[1;37m\]\u\[\033[0m\]"
- local user="\[\033[1;36m\]\u\[\033[0m\]"
+ # Colors depends on the id of the user.
+ # red = root (id 0)
+ if [ $(id -u) -eq 0 ]; then
+ local user="\[\033[1;31m\]\u\[\033[0m\]"
+ else
+ local user="\[\033[1;36m\]\u\[\033[0m\]"
+ fi
# Current folder only, ~ for home
local folder="\[\033[1;33m\]\W\[\033[0m\]"