Skip to content

Instantly share code, notes, and snippets.

@zikes
Last active Mar 23, 2022
Embed
What would you like to do?
Using kube-ps1 with P9K
# Enable the kube-ps1 oh-my-zsh plugin
plugins = (
git
kube-ps1
)
# The output of the kube_ps1 function is text, so it can be used
# directly as a custom p9k segment
POWERLEVEL9K_CUSTOM_KUBE_PS1='kube_ps1'
# Include the new custom segment in prompt_elements
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir custom_kube_ps1 vcs)
@zikes
Copy link
Author

zikes commented Jul 20, 2018

screenshot from 2018-07-20 13-34-36

@zikes
Copy link
Author

zikes commented Jul 20, 2018

Colorless alternative:

zsh_custom_kube_ps1(){
  echo -n "$(_kube_ps1_symbol)$KUBE_PS1_SEPERATOR$KUBE_PS1_CONTEXT$KUBE_PS1_DIVIDER$KUBE_PS1_NAMESPACE"
}
POWERLEVEL9K_CUSTOM_KUBE_PS1='zsh_custom_kube_ps1'

screenshot from 2018-07-20 13-49-33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment