# Prompt. Sourced by the stub BEFORE oh-my-zsh, and that placement is the whole # point of the file. # # oh-my-zsh loads the theme while it is being sourced, and powerlevel10k reads # its POWERLEVEL9K_* settings when it loads. Anything set afterwards is simply # ignored - the first attempt put ZSH_THEME in the role file, which is sourced # after oh-my-zsh, and the result was a shell with no powerlevel10k at all # while still reporting the right value in ZSH_THEME. # Only claim the theme if it is actually installed, otherwise oh-my-zsh falls # back to robbyrussell with a complaint. if [[ -d "${ZSH_CUSTOM:-$ZSH/custom}/themes/powerlevel10k" ]]; then ZSH_THEME="powerlevel10k/powerlevel10k" fi # Colour by role. Not decoration: shron carries mail, web and cloud, and a # glance at the prompt should be enough to know which machine the next command # is about to hit. Same segments everywhere so nothing else has to be relearned. case "$ROLE" in server) typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=red # Show the host even locally. Noise on a desktop, the one thing worth # always seeing here. typeset -g POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true ;; mobile) typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=green ;; *) typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=blue ;; esac