From a67dfae72b5d52b7e94304083a51d57c5c718e97 Mon Sep 17 00:00:00 2001 From: "L.C. Karssen" Date: Wed, 8 Jan 2014 10:45:05 +0100 Subject: [PATCH] Set colour for user@hostname to red if we're root (or sudo) in the bira theme. --- themes/bira.zsh-theme | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index 215720477..1ead93553 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -1,7 +1,13 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' + +if [[ $UID -eq 0 ]]; then + local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}' +else + local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' +fi + local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' local rvm_ruby='' if which rvm-prompt &> /dev/null; then