Skip to content

Instantly share code, notes, and snippets.

@vknabel
Last active May 27, 2024 06:05
Show Gist options
  • Select an option

  • Save vknabel/24b9d6720c3bc5a193fa7ba6a4d81b0d to your computer and use it in GitHub Desktop.

Select an option

Save vknabel/24b9d6720c3bc5a193fa7ba6a4d81b0d to your computer and use it in GitHub Desktop.

Revisions

  1. vknabel revised this gist May 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion p10k metal.zsh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ function prompt_metal_ctx() {
    p10k segment -f white -t "$(metal ctx show-current)"
    }
    function prompt_metalctl_ctx() {
    p10k segmen -f white t -t "$(metalctl ctx short)"
    p10k segment -f white -t "$(metalctl ctx short)"
    }
    function prompt_cloudctl_ctx() {
    p10k segment -f white -t "$(cloudctl ctx short)"
  2. vknabel created this gist May 24, 2024.
    25 changes: 25 additions & 0 deletions p10k metal.zsh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    function prompt_metal_ctx() {
    p10k segment -f white -t "$(metal ctx show-current)"
    }
    function prompt_metalctl_ctx() {
    p10k segmen -f white t -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'
    }