Jelajahi Sumber

Base: Make the default prompt a different color for root

Andreas Kling 4 tahun lalu
induk
melakukan
822d7da6cc
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      Base/etc/shellrc

+ 7 - 1
Base/etc/shellrc

@@ -31,4 +31,10 @@ alias rgrep="grep -r"
 alias egrep="grep -E"
 alias ll='ls -l'
 
-export PROMPT="\\X\\u@\\h:\\w\\a\\e[32;1m@\\h\\e[0m:\\e[34;1m\\w\\e[0m \\p "
+if [ "$(id -u)" = "0" ] {
+    prompt_color=31
+} else {
+    prompt_color=32
+}
+
+export PROMPT="\\X\\u@\\h:\\w\\a\\e[$prompt_color;1m@\\h\\e[0m:\\e[34;1m\\w\\e[0m \\p "