Files
dotconfs/.config/zsh/p10k-server.zsh
T
thomas.koppandClaude Opus 5.5 7edb68aaba fix(zsh): legible server prompt colours
Named ANSI colours are remapped by the terminal theme; under gruvbox
white-on-red and white-on-blue were barely readable. Use fixed 256-colour
indices with ~7:1 contrast.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 00:49:26 +02:00

53 lines
2.5 KiB
Bash

# powerlevel10k configuration for the server role.
#
# Deliberately not the wizard's output. A server is reached from whatever
# terminal happens to be at hand, so this uses ASCII rather than the icon set
# that assumes a Nerd Font, and keeps the segment list short enough to read at
# a glance during an incident.
#
# Sourced from 50-server.zsh, which runs after oh-my-zsh has loaded
# powerlevel10k - the same point in the sequence at which p10k expects its own
# ~/.p10k.zsh. beastix keeps its own file and is untouched by this.
# No glyphs. The prompt has to be legible from a phone terminal too.
typeset -g POWERLEVEL9K_MODE=ascii
typeset -g POWERLEVEL9K_ICON_PADDING=none
# One line, no frame. Nothing decorative survives being read in a hurry.
typeset -g POWERLEVEL9K_PROMPT_ON_NEWLINE=false
typeset -g POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs prompt_char)
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time time)
# The point of the whole exercise: user@host, always, in red. shron carries
# mail, web and cloud, and the prompt should answer "which machine is this"
# before the next command is typed.
typeset -g POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true
typeset -g POWERLEVEL9K_ALWAYS_SHOW_USER=true
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
#
# Fixed 256-colour indices, not the named ANSI colours. Terminal themes remap
# the first 16 freely - under gruvbox "white" is a mid grey and "blue" a muted
# teal, which left the text barely legible. 231 is pure white; 124 and 24 are
# dark enough to give it roughly 7:1 contrast on either segment.
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=124
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=231
typeset -g POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND=124
typeset -g POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND=231
typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=124
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=226
typeset -g POWERLEVEL9K_DIR_BACKGROUND=24
typeset -g POWERLEVEL9K_DIR_FOREGROUND=231
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=252
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=231
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
# Only mention how long something took when it was long enough to notice.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M}'
# Instant prompt would need a cache file this machine has no reason to carry.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
typeset -g POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true