summaryrefslogtreecommitdiffstats
path: root/.zsh/rc/15prompt
diff options
context:
space:
mode:
Diffstat (limited to '.zsh/rc/15prompt')
-rw-r--r--.zsh/rc/15prompt15
1 files changed, 12 insertions, 3 deletions
diff --git a/.zsh/rc/15prompt b/.zsh/rc/15prompt
index f462616..a897e19 100644
--- a/.zsh/rc/15prompt
+++ b/.zsh/rc/15prompt
@@ -34,9 +34,18 @@ parse_git_branch() {
precmd () {
# this has to be on the edge or you have some spaces in the prompt
# if you have any workaround please tell
-PROMPT="${fg_light_red}$USERNAME${fg_no_colour}@${fg_light_green}%m${fg_no_colour} \
-- ${fg_light_blue}%~${fg_no_colour} ${fg_purple}$(parse_git_branch)${fg_no_colour}
-[${fg_cyan}%*${fg_no_colour}] ${fg_red}$EXITCODE${fg_no_colour}> "
+if [[ $UID != 0 ]]; then
+ local username_color=$fg_blue
+else
+ local username_color=$fg_red
+fi
+local host_color=$fg_light_green
+local path_color=$fg_light_blue
+local gitbranch_color=$fg_purple
+local exitcode_color=$fg_red
+PROMPT="${username_color}$USERNAME${fg_no_colour}@${host_color}%m${fg_no_colour}\
+:${path_color}%~${fg_no_colour} ${gitbranch_color}$(parse_git_branch)${fg_no_colour}
+${exitcode_color}$EXITCODE${fg_no_colour}> "
}
## Spelling prompt