diff --git a/via.zsh-theme b/via.zsh-theme index 41e4ff6069c21bee7401cfc1e123acc80ef77e29..9814e78baf397055a68f4660518b22b87c650f22 100644 --- a/via.zsh-theme +++ b/via.zsh-theme @@ -1,4 +1,23 @@ # VIA ZSH Theme - Preview: ASAP # Fork from the historical VIA ZSH Theme -PROMPT='%{$fg_bold[cyan]%}%T %{$fg_bold[red]%}%n%{$fg_bold[yellow]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%c%{$fg_bold[yellow]%}%% ' +local clock="%{$fg_bold[cyan]%}%T%{$reset_color%}" + +# Check the UID +if [[ $UID -ne 0 ]]; +then + # normal user + local user="%{$fg_bold[red]%}%n%{$reset_color%}" + local eol="%{$fg_bold[yellow]%}%%%{$reset_color%}" +else + # root + local user="%{$fg_bold[blue]%}%n%{$reset_color%}" + local eol="%{$fg_bold[yellow]%}#%{$reset_color%}" +fi + +local user_host="${user}%{$fg_bold[yellow]%}@%{$fg_bold[white]%}%m%{$reset_color%}" + +local current_dir="%{$fg_bold[green]%}%c%{$reset_color%}" + +PROMPT="${clock} ${user_host} ${current_dir}${eol} " +