metal theme Aws-profile option added!

pull/1337/head
jrab66 2019-02-26 10:51:35 -06:00
parent caf50aba55
commit 133556f46a
1 changed files with 22 additions and 3 deletions

View File

@ -9,8 +9,15 @@
# inspired by previous bash_it theme : cupcake
# aws credentials support
# based in bash profile
#https://github.com/jrab66/aws-profile-bash-prompt
# to set the AWS-profile option download the aws-profile and add it to ~/.local/bin/ dir
# Demo:
# ┌ⓔ virtualenv 🐲🤘user @ 💻 host in 🗂️ directory on 🌵 branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗
# ┌ⓔ virtualenv 🐲🤘user @ 💻 host in [ AWS-profile] 🤖 🗂️ directory on 🌵 branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗
# └❯ cd .bash-it/themes/cupcake
# virtualenv prompts
@ -37,13 +44,13 @@ GIT_THEME_PROMPT_DIRTY=" ${red}✗${normal}"
GIT_THEME_PROMPT_CLEAN=" ${bold_green}${normal}"
GIT_THEME_PROMPT_PREFIX=""
GIT_THEME_PROMPT_SUFFIX=""
# ICONS =======================================================================
icon_start="┌"
icon_user="🤘-🐧"
icon_host="@ 💻 "
icon_directory=" - 🧱 "
icon_cloud="🤖"
icon_branch="🌵"
icon_end="└🤘-> "
@ -58,6 +65,14 @@ function virtualenv_prompt {
echo -e "$VIRTUALENV_CHAR$virtualenv "
fi
}
#aws
function aws_prompt {
if [[ -n "$AWS_DEFAULT_PROFILE" ]]; then
aws_cred=`"$AWS_DEFAULT_PROFILE"`
echo -e "$AWS_DEFAULT_PROFILE"
fi
}
# Rename tab
function tabname {
@ -73,8 +88,12 @@ function winname {
# Displays the current prompt
function prompt_command() {
PS1="\n${icon_start}$(virtualenv_prompt)${icon_user}${bold_green}\u${normal}${icon_host}${bold_cyan}\h${normal}${icon_directory}${bold_purple}\W${normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white}$(scm_prompt_info)${normal}\n${icon_end}"
#PS1="\n${icon_start}$(virtualenv_prompt)${icon_user}${bold_green}\u${normal}${icon_host}${bold_cyan}\h${normal}${icon_directory}${bold_purple}\W${normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white}$(scm_prompt_info)${normal}\n${icon_end}"
#PS2="${icon_end}"
#PS1="\[${green}\]AWS [\[${red}\]$AWS_DEFAULT_PROFILE\[${green}\]]:\[${reset}\] \w $ "
PS1="\n${icon_start}$(virtualenv_prompt)${icon_user}${bold_green}\u${normal}${icon_host}${bold_cyan}\h\[${green}\] ${icon_cloud} [\[${bold_red}\]$AWS_DEFAULT_PROFILE\[${green}\]]:\[${reset}\]${icon_directory}${bold_purple}\W${normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white}$(scm_prompt_info)${normal}\n${icon_end}"
PS2="${icon_end}"
}
# Runs prompt (this bypasses bash_it $PROMPT setting)