Update fzf location
[dotfiles] / .bash_prompts
1 #!/bin/sh
2
3 # http://stackoverflow.com/questions/103857/what-is-your-favorite-bash-prompt
4
5 nonzero_return() {
6 RETVAL=$?
7 [ $RETVAL -ne 0 ] && echo "$RETVAL"
8 }
9
10 # set a fancy prompt (non-color, unless we know we "want" color)
11 case "$TERM" in
12 xterm-color|*-256color) color_prompt=yes;;
13 esac
14
15 # uncomment for a colored prompt, if the terminal has the capability; turned
16 # off by default to not distract the user: the focus in a terminal window
17 # should be on the output of commands, not on the prompt
18 force_color_prompt=yes
19
20 if [ -n "$force_color_prompt" ]; then
21 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
22 # We have color support; assume it's compliant with Ecma-48
23 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
24 # a case would tend to support setf rather than setaf.)
25 color_prompt=yes
26 else
27 color_prompt=
28 fi
29 fi
30
31 if [ "$color_prompt" = yes ] ; then
32 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
33 [ "$USER" != "root" ] && PS1=$'\w \[\033[1;33m\]$(__git_ps1 " (%s)")\[\033[0m\] \n>> '
34 [ "$USER" = "root" ] && PS1='${debian_chroot:+($debian_chroot)}\w \n\u\$ '
35 else
36 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
37 fi
38 unset color_prompt force_color_prompt
39
40 # If this is an xterm set the title to user@host:dir
41 case "$TERM" in
42 xterm*|rxvt*)
43 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
44 ;;
45 *)
46 ;;
47 esac