diff --git a/README.md b/README.md index e3edca5..20caaeb 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,17 @@ NOTE: You do not need to specify *end* segment - it will be added automatically. |`BULLETTRAIN_GO_FG`|`white`|Foreground color |`BULLETTRAIN_GO_PREFIX`|`go`|Prefix of the segment +### AWS Profile + +Displays which AWS (Amazon Web Services) credentials profile is currently set. +This environment var is used by aws-cli and other tools to use the right access keys and other parameters. + +|Variable|Default|Meaning +|--------|-------|-------| +|`BULLETTRAIN_AWS_BG`|`yellow`|Background color +|`BULLETTRAIN_AWS_FG`|`black`|Foreground color +|`BULLETTRAIN_AWS_PREFIX`|`☁️`|Prefix of the segment + ### Perl |Variable|Default|Meaning diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 4561781..b7c7c9a 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -27,6 +27,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then ruby virtualenv nvm + aws go elixir git @@ -104,6 +105,17 @@ if [ ! -n "${BULLETTRAIN_NVM_PREFIX+1}" ]; then BULLETTRAIN_NVM_PREFIX="⬡ " fi +# AWS +if [ ! -n "${BULLETTRAIN_AWS_BG+1}" ]; then + BULLETTRAIN_AWS_BG=yellow +fi +if [ ! -n "${BULLETTRAIN_AWS_FG+1}" ]; then + BULLETTRAIN_AWS_FG=black +fi +if [ ! -n "${BULLETTRAIN_AWS_PREFIX+1}" ]; then + BULLETTRAIN_AWS_PREFIX="☁️" +fi + # RUBY if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then BULLETTRAIN_RUBY_BG=red @@ -517,6 +529,15 @@ prompt_nvm() { prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$nvm_prompt } +#AWS Profile +prompt_aws() { + local spaces=" " + + if [[ -n "$AWS_PROFILE" ]]; then + prompt_segment $BULLETTRAIN_AWS_BG $BULLETTRAIN_AWS_FG $BULLETTRAIN_AWS_PREFIX$spaces$AWS_PROFILE + fi +} + prompt_time() { if [[ $BULLETTRAIN_TIME_12HR == true ]]; then prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}