mirror of
https://github.com/arcan1s/dotfiles.git
synced 2025-04-24 16:07:17 +00:00
29 lines
901 B
Bash
29 lines
901 B
Bash
# PROMPT && RPROMPT
|
|
if [[ $EUID == 0 ]]; then
|
|
# [root@host dir]#
|
|
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
|
%{$fg_bold[red]%}%n%{$reset_color%}\
|
|
%{$fg_bold[white]%}@%{$reset_color%}\
|
|
%{$fg_no_bold[red]%}%M %{$reset_color%}\
|
|
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
|
%{$fg_bold[white]%}]# %{$reset_color%}"
|
|
else
|
|
# [user@host dir]$
|
|
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
|
%{$fg_bold[green]%}%n%{$reset_color%}\
|
|
%{$fg_bold[white]%}@%{$reset_color%}\
|
|
%{$fg_no_bold[green]%}%M %{$reset_color%}\
|
|
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
|
%{$fg_bold[white]%}]$ %{$reset_color%}"
|
|
fi
|
|
precmd() {
|
|
# last command
|
|
returncode="%(?.%{$fg[green]%}.%{$fg[red]%})%?%{$resetcolor%}"
|
|
RPROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
|
%{$fg_bold[cyan]%}%T%{$reset_color%}\
|
|
%{$fg_bold[white]%}]%{$reset_color%}"\
|
|
"%{$fg_bold[white]%}[%{$reset_color%}"\
|
|
${returncode}\
|
|
"%{$fg_bold[white]%}]%{$reset_color%}"
|
|
}
|