Last active
June 22, 2020 15:44
-
-
Save oguzbilgener/065546f0fb099d86755ac768d702628b to your computer and use it in GitHub Desktop.
p10k-segment-twilio-cli-profile
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
# A custom segment for Powerlevel10k Zsh theme to print the currently active twilio-cli acount profile short name. This segment activates only when you type the command `twilio`. | |
typeset -g POWERLEVEL9K_MY_TWILIO_SHOW_ON_COMMAND='twilio' | |
function prompt_my_twilio() { | |
if [[ -f ~/.twilio-cli/config.json ]]; then | |
TWILIO_PROFILE_NAME=$(cat ~/.twilio-cli/config.json \ | |
| jq '.activeProject' \ | |
| awk '{print substr($1, 2, length($1)-2)}') | |
p10k segment -f 160 -i $'\uf095' -t "$TWILIO_PROFILE_NAME" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment