Skip to content

Commit

Permalink
FIxed bash scirpt
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vala committed Jul 10, 2014
1 parent b9f3a98 commit 0646b05
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bash/.config/.prompt.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/bin/bash

source /usr/share/git-core/contrib/completion/git-prompt.sh
if [ "$PS1" ];then
export PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \W\[\033[01;33m\]\$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] "
fi
export PROMPT_DIRTRIM=1
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true

settitle() {
printf "\033k$1\033\\"
}
Expand All @@ -17,3 +9,15 @@ ssh() {
command ssh "$@"
settitle "bash"
}


if [ "$PS1" ];then
source /usr/share/git-core/contrib/completion/git-prompt.sh
export PROMPT_DIRTRIM=1
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
if [ -n "$DISPLAY" ];then
export PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \W\[\033[01;33m\]\$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] "
fi
fi

0 comments on commit 0646b05

Please sign in to comment.