From: Mart Lubbers Date: Tue, 2 Dec 2014 07:32:42 +0000 (+0100) Subject: ps1 customize X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=2ed6d7793226220a23804b216a10063f44391217;p=dotfiles.git ps1 customize --- diff --git a/.bashrc b/.bashrc index c7c30d0..28063f1 100644 --- 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'