ps1 customize
authorMart Lubbers <mart@martlubbers.net>
Tue, 2 Dec 2014 07:32:42 +0000 (08:32 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 2 Dec 2014 07:32:42 +0000 (08:32 +0100)
.bashrc

diff --git a/.bashrc b/.bashrc
index c7c30d0..28063f1 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -16,3 +16,12 @@ alias ls='ls --color=auto'
 alias grep='grep --color=auto'
 
 [ ! -s ~/.config/mpd/pid ] && mpd
+
+source /usr/share/git/completion/git-prompt.sh
+set_prompt(){
+       last_c=$?
+       PS1='\u@\h'
+       [[ $last_c -ge 1 ]] && PS1="($last_c) $PS1"
+       PS1="$PS1\w$(__git_ps1)\$ "
+}
+PROMPT_COMMAND='set_prompt'