... | ... |
@@ -1,4 +1,4 @@ |
1 |
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi |
|
1 |
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi |
|
2 | 2 |
|
3 | 3 |
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' |
4 | 4 |
RPROMPT='[%*]' |
... | ... |
@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" |
5 | 5 |
ZSH_THEME_GIT_PROMPT_CLEAN="" |
6 | 6 |
|
7 | 7 |
function prompt_char { |
8 |
- if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi |
|
8 |
+ if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi |
|
9 | 9 |
} |
10 | 10 |
|
11 | 11 |
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png |
2 | 2 |
|
3 |
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi |
|
3 |
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi |
|
4 | 4 |
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" |
5 | 5 |
|
6 | 6 |
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \ |
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi |
|
1 |
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi |
|
2 | 2 |
|
3 | 3 |
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' |
4 | 4 |
RPROMPT='[%*]' |