summaryrefslogtreecommitdiffstats
path: root/myconfig.sh
blob: 21ed66ec98bc4ff49a3800150225bbf85a21118c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# use it like this in .bashrc
#
# if [[ -f ~/.myconfig.sh ]]; then
#     source ~/.myconfig.sh
# fi

# git completion and custom PS1
#source /usr/share/git/completion/git-prompt.sh
source /usr/share/git/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=1

if [[ $(id -u) -eq 0 ]]; then
    PS1='\[\e[1;37m\][\[\e[m\]\[\e[1;31m\]\u\[\e[m\]@\[\e[1;37m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]\[\e[1;37m\]]\[\e[m\]\[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
else
    PS1='\[\e[1;37m\][\[\e[m\]\[\e[1;32m\]\u\[\e[m\]@\[\e[1;37m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[m\]\[\e[1;37m\]]\[\e[m\]\[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
fi

# aliases
alias bb='history -c && history -w && reset'