Skip to content

Instantly share code, notes, and snippets.

@cmsouza
Last active December 26, 2016 20:37
Show Gist options
  • Save cmsouza/36afe2307a2ea83d750e to your computer and use it in GitHub Desktop.
Save cmsouza/36afe2307a2ea83d750e to your computer and use it in GitHub Desktop.
Bash prompts marotos
# no seu bashrc
if [ ! -f ~/.bash-gitprompt.sh ]; then
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.bash-gitprompt.sh
fi
source ~/.bash-gitprompt.sh
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;37m\]\u@\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;36m\]$\[\033[00m\] '
# no do root
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;30m\]\u@\h\[\033[01;34m\] \w\[\033[35m\] \[\033[01;31m\]#\[\033[00m\] '
# nas vms
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;33m\]\u@\h\[\033[01;34m\] \w\[\033[35m\] \[\033[01;30m\]$\[\033[00m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment