add gitstatus prompt

This commit is contained in:
Ray Elliott 2022-03-12 17:36:58 +00:00
parent d5ca23a06c
commit 39ce8b048f
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
gitstatus

3
bashrc
View File

@ -8,7 +8,8 @@ export SHELL_CONFIG="$SHELL_CONFIG:.bashrc"
export HISTCONTROL=ignoreboth:erasedups
PS1='[\u@\h \W]\$ '
[ -f "$HOME/.config/bash/gitstatus/gitstatus.prompt.sh" ] && . "$HOME/.config/bash/gitstatus/gitstatus.prompt.sh"
PS1='\t \[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]${GITSTATUS_PROMPT:+ $GITSTATUS_PROMPT}\n\[\033[01;$((31+!$?))m\]\$\[\033[00m\] \[\e]0;\u@\h: \w\a\]'
source ~/.profile

View File

@ -10,3 +10,8 @@ fi
ln -s "$HOME/.config/bash/bash_profile" "$HOME/.bash_profile"
ln -s "$HOME/.config/bash/bashrc" "$HOME/.bashrc"
# https://github.com/romkatv/gitstatus#using-from-bash
if [ ! -d "$HOME/.config/bash/gitstatus" ] ; then
git clone --depth=1 https://github.com/romkatv/gitstatus.git "$HOME/.config/bash/gitstatus"
fi