|
|
@ -1131,6 +1131,25 @@ _p9k_prompt_anaconda_init() {
|
|
|
|
# AWS Profile
|
|
|
|
# AWS Profile
|
|
|
|
prompt_aws() {
|
|
|
|
prompt_aws() {
|
|
|
|
local aws_profile="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}"
|
|
|
|
local aws_profile="${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}"
|
|
|
|
|
|
|
|
local text="${aws_profile//\%/%%}"
|
|
|
|
|
|
|
|
if (( _POWERLEVEL9K_AWS_SHOW_REGION )); then
|
|
|
|
|
|
|
|
local region_full
|
|
|
|
|
|
|
|
if [[ -v $AWS_DEFAULT_REGION ]]; then
|
|
|
|
|
|
|
|
region_full=$AWS_DEFAULT_REGION
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if ! _p9k_cache_get "$0-$aws_profile-full"; then
|
|
|
|
|
|
|
|
_p9k_cache_set $(aws configure get region)
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
region_full=$_p9k__cache_val[1]
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( _POWERLEVEL9K_AWS_SHOW_REGION_SHORT )); then
|
|
|
|
|
|
|
|
local region_short=${${${${${${region_full//-}//north/n}//south/s}//east/e}//west/w}//gov/g}
|
|
|
|
|
|
|
|
text="$text ($region_short)"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
text="$text ($region_full)"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
local pat class
|
|
|
|
local pat class
|
|
|
|
for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do
|
|
|
|
for pat class in "${_POWERLEVEL9K_AWS_CLASSES[@]}"; do
|
|
|
|
if [[ $aws_profile == ${~pat} ]]; then
|
|
|
|
if [[ $aws_profile == ${~pat} ]]; then
|
|
|
@ -1138,7 +1157,7 @@ prompt_aws() {
|
|
|
|
break
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
_p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "${aws_profile//\%/%%}"
|
|
|
|
_p9k_prompt_segment "$0$state" red white 'AWS_ICON' 0 '' "$text"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_p9k_prompt_aws_init() {
|
|
|
|
_p9k_prompt_aws_init() {
|
|
|
@ -7379,6 +7398,8 @@ _p9k_init_params() {
|
|
|
|
# POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow
|
|
|
|
# POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow
|
|
|
|
_p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_AWS_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_AWS_CLASSES --
|
|
|
|
|
|
|
|
_p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION 0
|
|
|
|
|
|
|
|
_p9k_declare -b POWERLEVEL9K_AWS_SHOW_REGION_SHORT 1
|
|
|
|
_p9k_declare -a POWERLEVEL9K_AZURE_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_AZURE_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES --
|
|
|
|
_p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES --
|
|
|
|
_p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT 0
|
|
|
|
_p9k_declare -b POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT 0
|
|
|
|