mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-24 04:29:25 +02:00
root gets red dir on blecher.at-agnoster theme
This commit is contained in:
parent
3340bf248a
commit
4e81640ec4
1 changed files with 6 additions and 2 deletions
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
CURRENT_BG='NONE'
|
||||
SEGMENT_SEPARATOR=''
|
||||
DIR_COLOR='blue'
|
||||
|
||||
# Begin a segment
|
||||
# Takes two arguments, background and foreground. Both can be omitted,
|
||||
|
|
@ -62,6 +63,9 @@ prompt_end() {
|
|||
# Context: user@hostname (who am I and where am I)
|
||||
prompt_context() {
|
||||
local user=`whoami`
|
||||
if [[ "$user" == "root" ]]; then
|
||||
DIR_COLOR=red
|
||||
fi
|
||||
|
||||
if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||
prompt_segment black default "%(!.%{%F{yellow}%}.)$user@%m"
|
||||
|
|
@ -83,7 +87,7 @@ prompt_git() {
|
|||
|
||||
# Dir: current working directory
|
||||
prompt_dir() {
|
||||
prompt_segment blue black '%~'
|
||||
prompt_segment $DIR_COLOR black '%~'
|
||||
}
|
||||
|
||||
# Fast method to get the current branch in git from https://gist.github.com/wolever/6525437
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue