Open jerome-diver opened 5 years ago
Would a custom prompt segment work for you instead of modifying a core segment?
zsh_dir_owner(){
owner=$(stat -c "%U" .)
if [[ "$owner" == 'www-data' ]]; then
echo $owner
fi
}
POWERLEVEL9K_CUSTOM_DIR_OWNER="zsh_dir_owner"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=($POWERLEVEL9K_LEFT_PROMPT_ELEMENTS custom_dir_owner)
POWERLEVEL9K_CUSTOM_DIR_OWNER_BACKGROUND=yellow
POWERLEVEL9K_CUSTOM_DIR_OWNER_FORGROUND=black
You could even change the check to something like this to show the segment if you're in a directory owned by anyone other than the current user:
if [[ "$owner" != "$USER" ]]; then
echo $owner
fi
Hi and thank you for powerlevel9k, very nice prompt (i use it with zsh, it is perfect). I would like to create a special directory color. For example, i can define a POWERLEVEL9K_DIR_HOME_BACKGOUND color... In the same way, i would like to define a kind of POWERLEVEL9K_DIR_HTTP_BACKGROUND color for directories where user is "http" (for http user), but not the home directory of http user. Is it possible and how to do that please ?