Last active
February 27, 2023 16:16
-
-
Save natemccurdy/8bb539b81c30b44685b07ca23e57c111 to your computer and use it in GitHub Desktop.
A Powerlevel10k prompt segment for your VAULT_ADDR
This file contains 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
# Create a Powerlevel10k prompt segment that shows that value of $VAULT_ADDR if set. | |
function prompt_my_vault_addr() { | |
if [[ -n $VAULT_ADDR ]]; then | |
p10k segment -i '🔐' -f brightwhite -b blue -t "$VAULT_ADDR" | |
fi | |
} | |
# Add it to the right prompt. | |
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=my_vault_addr | |
# Only show it when running 'vault'. | |
typeset -g POWERLEVEL9K_MY_VAULT_ADDR_SHOW_ON_COMMAND='vault' |
Author
natemccurdy
commented
Feb 22, 2023
There's an actual Hashicorp Vault icon in the devicons/devicon project: devicons/devicon#1609
Powerlevel10k uses NerdFonts, which includes an unmaintained version of devicons (vorillaz/devicons).
The devicons/devicon project is actively maintained and has more icons, and NerdFonts is trying to migrate to the newer project, but that hasn't completed yet: ryanoasis/nerd-fonts#615
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment