From a912530f6f41c8739d94a5c06ea7d4b07ee36c56 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sun, 1 May 2022 13:40:00 +0200 Subject: [PATCH] zsh:p10k: Modify `context` segment format template Display only `user` when not in a remote shell and `user@hostname` when connected. Display the content in bold when running with privileges (no SSH & SSH). --- .../90-external-plugins/15-powerlevel10k.theme | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme b/.config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme index 9c56caa..64169ec 100644 --- a/.config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme +++ b/.config/zsh/zshrc.d/90-external-plugins/15-powerlevel10k.theme @@ -850,12 +850,14 @@ # Default context color (no privileges, no SSH). typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 - # Context format when running with privileges: bold user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' + # Default context format (no privileges, no SSH): user. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n' + # Context format when running with privileges: bold user. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n' # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + typeset -g POWERLEVEL9K_CONTEXT_REMOTE_TEMPLATE='%n@%m' + # Context format when in SSH with privileges: bold user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_REMOTE_SUDO_TEMPLATE='%B%n@%m' # Don't show context unless running with privileges or in SSH. # Tip: Remove the next line to always show context.