From f0451195f63b3607461bda1570c5fb2a4e429b3e Mon Sep 17 00:00:00 2001 From: Maxim Filatov Date: Sun, 5 Jun 2011 16:57:21 -0700 Subject: [PATCH] Dollar sign instead of percent in unprivileged user prompt (as in real gentoo) --- themes/gentoo.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme index cba143d4..ee205d24 100644 --- a/themes/gentoo.zsh-theme +++ b/themes/gentoo.zsh-theme @@ -1,4 +1,8 @@ -PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} ' +function prompt_char { + if [ $UID -eq 0 ]; then echo "#"; else echo $; fi +} + +PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="(" ZSH_THEME_GIT_PROMPT_SUFFIX=") "