Last active
October 26, 2023 09:52
-
-
Save pysysops/b0fd78aa52629f321034289af042be24 to your computer and use it in GitHub Desktop.
Powerlevel10k custom prompt config for use with aws-vault https://github.com/99designs/aws-vault
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
##############[ custom_awsvault: current aws account (https://github.com/99designs/aws-vault) ]############### | |
awsvault_prompt() { | |
if [ ! -z "${AWS_VAULT-}" ]; then | |
echo -n " ${AWS_VAULT-} " | |
fi | |
} | |
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT="awsvault_prompt" | |
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_FOREGROUND="black" | |
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_BACKGROUND="yellow" | |
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_VISUAL_IDENTIFIER_EXPANSION=' ☁️' |
Hello @pysysops, I was brought to this gist when I googled "powerlevel10k aws-vault" earlier. 😄
However, I can't seem to get this custom prompt working, and I'm curious if it's because I'm running aws-vault
v6.1.0.
If you have a moment, could you confirm which version of aws-vault
you are using? Thanks in advance!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use
aws-vault
to move around AWS accounts and assume roles within the accounts I work with. I use Powerlevel10k (https://github.com/romkatv/powerlevel10k) to customize my zsh shell.There's a few occasions when I've run a Terraform plan or being searching for some answer in the wrong account. The above custom prompt code will help you to avoid that by making the current account you're "in".
Add the code in this gist and add a reference to the prompt wherever you'd like it to appear:
Example:
