Skip to content

Instantly share code, notes, and snippets.

@oguzbilgener
Last active June 22, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oguzbilgener/065546f0fb099d86755ac768d702628b to your computer and use it in GitHub Desktop.
Save oguzbilgener/065546f0fb099d86755ac768d702628b to your computer and use it in GitHub Desktop.
p10k-segment-twilio-cli-profile
# 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