Hi, I have an example that adds colour and different prompt symbols for user and root.
I can't reference the script, lost/forgot.
here is part of,
~/.zshrc....
Code:
# Set a colour prompt # home
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOR="%{$terminfo[sgr0]%}"
if [ `whoami` = 'root' ]; then
PS1="$PR_RED%n$PR_NO_COLOR@$PR_BLUE%m%u$PR_NO_COLOR:$PR_CYAN%2c$PR_RED%(!.#.$) "
else
PS1="$PR_GREEN%n$PR_NO_COLOR@$PR_BLUE%m%u$PR_NO_COLOR:$PR_CYAN%2c$PR_YELLOW%(!.#.$) "
fi
# Put a clock on the right hand prompt
RPS1="$PR_CYAN(%D{%d-%m %H:%M})$PR_NO_COLOR"
looks like this...
Code:
glenn@GamesBox:~$ su (01-08 09:39)
root@GamesBox:~# (01-08 09:39)
You can add this to the root .zshrc as well.
Hope this helps, for more about zshell and it's use, look up "
bash2zsh", "Jerry Peek"
https://www.coderanch.com/t/93722/Bo...r-Kiddle-Jerry
And Jerry peek's Magazine articles.
Cheers Glenn