metal theme Aws-profile option added!
parent
caf50aba55
commit
133556f46a
|
|
@ -9,8 +9,15 @@
|
||||||
|
|
||||||
# inspired by previous bash_it theme : cupcake
|
# 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:
|
# 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
|
# └❯ cd .bash-it/themes/cupcake
|
||||||
|
|
||||||
# virtualenv prompts
|
# virtualenv prompts
|
||||||
|
|
@ -37,13 +44,13 @@ GIT_THEME_PROMPT_DIRTY=" ${red}✗${normal}"
|
||||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||||
GIT_THEME_PROMPT_PREFIX=""
|
GIT_THEME_PROMPT_PREFIX=""
|
||||||
GIT_THEME_PROMPT_SUFFIX=""
|
GIT_THEME_PROMPT_SUFFIX=""
|
||||||
|
|
||||||
# ICONS =======================================================================
|
# ICONS =======================================================================
|
||||||
|
|
||||||
icon_start="┌"
|
icon_start="┌"
|
||||||
icon_user="🤘-🐧"
|
icon_user="🤘-🐧"
|
||||||
icon_host="@ 💻 "
|
icon_host="@ 💻 "
|
||||||
icon_directory=" - 🧱 "
|
icon_directory=" - 🧱 "
|
||||||
|
icon_cloud="🤖"
|
||||||
icon_branch="🌵"
|
icon_branch="🌵"
|
||||||
icon_end="└🤘-> "
|
icon_end="└🤘-> "
|
||||||
|
|
||||||
|
|
@ -58,6 +65,14 @@ function virtualenv_prompt {
|
||||||
echo -e "$VIRTUALENV_CHAR$virtualenv "
|
echo -e "$VIRTUALENV_CHAR$virtualenv "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
#aws
|
||||||
|
|
||||||
|
function aws_prompt {
|
||||||
|
if [[ -n "$AWS_DEFAULT_PROFILE" ]]; then
|
||||||
|
aws_cred=`"$AWS_DEFAULT_PROFILE"`
|
||||||
|
echo -e "$AWS_DEFAULT_PROFILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Rename tab
|
# Rename tab
|
||||||
function tabname {
|
function tabname {
|
||||||
|
|
@ -73,8 +88,12 @@ function winname {
|
||||||
|
|
||||||
# Displays the current prompt
|
# Displays the current prompt
|
||||||
function prompt_command() {
|
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}"
|
PS2="${icon_end}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Runs prompt (this bypasses bash_it $PROMPT setting)
|
# Runs prompt (this bypasses bash_it $PROMPT setting)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue