summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-01-08 21:44:21 +0530
committersinanmohd <sinan@sinanmohd.com>2024-01-08 21:44:51 +0530
commit279654d9e5c91413596c2328e6de4dc35d2c4dc5 (patch)
tree538385953368566309154e1f37a40f139cca4dcb
parent75b2100504c5d5eb242388a7c92f7819e6a2dd20 (diff)
common: refactor bash prompt
-rw-r--r--common.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/common.nix b/common.nix
index f550d7c..5483f63 100644
--- a/common.nix
+++ b/common.nix
@@ -94,9 +94,11 @@ in
# programs
programs.bash.promptInit = ''
- PROMPT_COLOR="1;31m"
- [ "$UID" -ne 0 ] &&
+ if [ "$UID" -ne 0 ]; then
PROMPT_COLOR="1;32m"
+ else
+ PROMPT_COLOR="1;31m"
+ fi
PS1="\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] "
'';