mirror of
https://github.com/ivabus/ivabus-zsh-theme
synced 2024-11-10 02:25:17 +03:00
Add hostname
This commit is contained in:
parent
fe1d46be82
commit
09dcfa0030
|
@ -2,14 +2,16 @@
|
||||||
__zsh_prompt() {
|
__zsh_prompt() {
|
||||||
local prompt_username
|
local prompt_username
|
||||||
prompt_username="%n"
|
prompt_username="%n"
|
||||||
if [[ $UID == 0 || $EUID == 0 ]]; then # check if root for red colors for username
|
local prompt_hostname
|
||||||
PROMPT="%{$fg[red]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )"
|
prompt_hostname="%m"
|
||||||
|
if [[ $UID == 0 || $EUID == 0 ]]; then
|
||||||
|
PROMPT="%{$fg[red]%}${prompt_username}%{$reset_color%}@%{$fg[red]%}${prompt_hostname} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )"
|
||||||
else
|
else
|
||||||
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )"
|
PROMPT="%{$fg[green]%}${prompt_username}%{$reset_color%}@%{$fg[cyan]%}${prompt_hostname} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
|
||||||
fi
|
fi
|
||||||
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
|
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
|
||||||
PROMPT+='$(git_prompt_info)' # Git status
|
PROMPT+='$(git_prompt_info)' # Git status
|
||||||
if [[ $UID == 0 || $EUID == 0 ]]; then # again root and red colors but now for indicator
|
if [[ $UID == 0 || $EUID == 0 ]]; then
|
||||||
PROMPT+='%{$fg[red]%}# %{$reset_color%}'
|
PROMPT+='%{$fg[red]%}# %{$reset_color%}'
|
||||||
else
|
else
|
||||||
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
|
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
|
||||||
|
|
Loading…
Reference in a new issue