From 8c924530d67fc74a0c7a219e5aab2c7d197397f5 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Sun, 25 Sep 2022 18:39:47 +0300 Subject: [PATCH] Remove stupid as f `@` and add root indication --- ivabus.zsh-theme | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ivabus.zsh-theme b/ivabus.zsh-theme index 928337b..adf139a 100644 --- a/ivabus.zsh-theme +++ b/ivabus.zsh-theme @@ -1,11 +1,19 @@ # ivabus zsh prompt theme __zsh_prompt() { local prompt_username - prompt_username="@%n" - PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow + prompt_username="%n" + if [[ $UID == 0 || $EUID == 0 ]]; then + PROMPT="%{$fg[red]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" + else + PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow + fi PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd PROMPT+='$(git_prompt_info)' # Git status - PROMPT+='%{$fg[white]%}$ %{$reset_color%}' + if [[ $UID == 0 || $EUID == 0 ]]; then + PROMPT+='%{$fg[red]%}# %{$reset_color%}' + else + PROMPT+='%{$fg[white]%}$ %{$reset_color%}' + fi unset -f __zsh_prompt } ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"