diff --git a/themes/metal/metal.theme.bash b/themes/metal/metal.theme.bash index e0eddd26..cfb6cee6 100644 --- a/themes/metal/metal.theme.bash +++ b/themes/metal/metal.theme.bash @@ -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)