Last active
May 27, 2024 06:05
-
-
Save vknabel/24b9d6720c3bc5a193fa7ba6a4d81b0d to your computer and use it in GitHub Desktop.
powerlevel10k prompts for metal, metalctl and cloudctl contexts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt_metal_ctx() { | |
p10k segment -f white -t "$(metal ctx show-current)" | |
} | |
function prompt_metalctl_ctx() { | |
p10k segment -f white -t "$(metalctl ctx short)" | |
} | |
function prompt_cloudctl_ctx() { | |
p10k segment -f white -t "$(cloudctl ctx short)" | |
} | |
() { | |
# Left prompt segments. | |
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( | |
# =========================[ Line #1 ]========================= | |
# ... | |
metal_ctx | |
metalctl_ctx | |
cloudctl_ctx | |
# ... | |
) | |
typeset -g POWERLEVEL9K_METAL_CTX_SHOW_ON_COMMAND='metal' | |
typeset -g POWERLEVEL9K_METALCTL_CTX_SHOW_ON_COMMAND='metalctl' | |
typeset -g POWERLEVEL9K_CLOUDCTL_CTX_SHOW_ON_COMMAND='cloudctl' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment