update bash prompt, drop vcprompt in favor of git-prompt.sh
[dotfiles] / .bashrc
1 #!/bin/sh
2
3 # a=1; find . -type f -print0 | while read -d $'\0' file; do new=$(printf "%04d.jpg" "$a"); mv "$file" $new; let a=a+1; done
4
5 # personal export
6 [[ -f ~/.bash_export ]] && . ~/.bash_export
7
8 # git inside prompt
9 [[ -f ~/.git-prompt.sh ]] && . ~/.git-prompt.sh
10
11 alias get_aftv="wget --mirror -r ftp://www.africafilms.tv:6382765847@hebergement12.thalix.com --reject '*.sql' --reject '*.gz' --reject '*.back' --reject '*.f4v' --reject '*.metadata' --reject '*.txt' --reject '*.jpg' --reject '*.jpeg' --reject '*.png' --reject '*.gif' --reject '*.swf' --reject '*.xml' --reject '*.flv' --reject '*.wmv' --reject '*.mov' --reject '*.pdf' --reject '*.log*' --reject '*.mp4' --reject '*.svn-base'"
12
13 # python setup.py --command-packages=stdeb.command sdist_dsc
14
15 # dns servers 80.67.169.12 || 2001:910:800::12
16 # 31.14.133.188 (ns5.it) -- 99.30% uptime
17 # 87.98.242.252 (ns11.fr) -- 99.58% uptime
18 # 87.98.175.85 (ns10.fr) -- 99.61% uptime
19 # 193.183.98.154 (ns1.it) -- 99.84% uptime
20
21 # unicode characters https://en.wikipedia.org/wiki/List_of_Unicode_characters
22
23 # ~/.bashrc: executed by bash(1) for non-login shells.
24 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
25 # for examples
26
27
28 # If not running interactively, don't do anything
29 case $- in
30 *i*) ;;
31 *) return;;
32 esac
33
34
35 # make less more friendly for non-text input files, see lesspipe(1)
36 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
37
38 # set variable identifying the chroot you work in (used in the prompt below)
39 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
40 debian_chroot=$(cat /etc/debian_chroot)
41 fi
42
43 # set a fancy prompt (non-color, unless we know we "want" color)
44 case "$TERM" in
45 xterm-color) color_prompt=yes;;
46 esac
47
48 # uncomment for a colored prompt, if the terminal has the capability; turned
49 # off by default to not distract the user: the focus in a terminal window
50 # should be on the output of commands, not on the prompt
51 force_color_prompt=yes
52
53 if [ -n "$force_color_prompt" ]; then
54 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
55 # We have color support; assume it's compliant with Ecma-48
56 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
57 # a case would tend to support setf rather than setaf.)
58 color_prompt=yes
59 else
60 color_prompt=
61 fi
62 fi
63
64 # export command for coloring
65 # '\e[x;ym $PS1 \e[m' or [\033[x;ym\] $PS1 [\033[00m\] x;y being the color pair to use
66
67 if [ "$color_prompt" = yes ]; then
68 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "[%s]") \$ '
69 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] > '
70 if [ $USER='nsukami' ]; then
71 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]\[\033[0m\] > '
72 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w \[\033[1;33m\]\[\033[0m\] \n > '
73 #PS1='${debian_chroot:+($debian_chroot)}\[\033[31m\]\[\033[00m\]:\w \[\033[1;33m\]\[\033[0m\] \n '
74 #PS1=$'\u03c6 \w \[\033[1;33m\]\[\033[0m\] \n '
75 PS1=$'\w \[\033[1;33m\]$(__git_ps1 " (%s)")\[\033[0m\] \n\u2937 '
76 else
77 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(__git_ps1 " (%s)")\[\033[0m\] \n > '
78 fi
79 else
80 #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") \$ '
81 if [ $USER='nsukami' ]; then
82 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w > '
83 PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w $(__git_ps1 " (%s)")\n > '
84 else
85 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w $(__git_ps1 " (%s)")\n > '
86 fi
87
88 fi
89 unset color_prompt force_color_prompt
90
91 # If this is an xterm set the title to user@host:dir
92 case "$TERM" in
93 xterm*|rxvt*)
94 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w \a\]$PS1"
95 ;;
96 *)
97 ;;
98 esac
99
100 # enable color support of ls
101 if [ -x /usr/bin/dircolors ]; then
102 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
103 alias ls='ls --color=auto'
104 fi
105
106
107
108 # enable programmable completion features (you don't need to enable
109 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
110 # sources /etc/bash.bashrc).
111 if ! shopt -oq posix; then
112 if [ -f /usr/share/bash-completion/bash_completion ]; then
113 . /usr/share/bash-completion/bash_completion
114 elif [ -f /etc/bash_completion ]; then
115 . /etc/bash_completion
116 fi
117 fi
118
119 # start gpg agent
120 # be sure to have done apt install gpg-agent pinentry-curses first
121 eval `gpg-agent --daemon`
122
123 # print available tmux sessions if available
124 tmux list-sessions 2> /dev/null
125
126 # always put prompt at bottom
127 # PS1="\[$(tput cup "$LINES")\]"$PS1
128 # PS1='\[$(retval=$?;tput cup "$LINES";exit $retval)\]'$PS1
129
130 # Hook for desk activation
131 [ -n "$DESK_ENV" ] && source "$DESK_ENV"
132
133 # Alias definitions.
134 # You may want to put all your additions into a separate file like
135 # ~/.bash_aliases, instead of adding them here directly.
136 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
137 [[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
138
139 # git completion
140 [[ -f ~/.git_completion ]] && . ~/.git_completion
141
142 # personal customization
143 [[ -f ~/.bash_customization ]] && . ~/.bash_customization
144
145 # personal functions
146 [[ -f ~/.bash_function ]] && . ~/.bash_function
147
148 # personal export
149 [[ -f ~/.bash_export ]] && . ~/.bash_export
150
151 # personal color
152 [[ -f ~/.bash_color ]] && . ~/.bash_color
153
154 # personal shopt
155 [[ -f ~/.bash_shopt ]] && . ~/.bash_shopt
156
157 # git completion
158 [[ -f ~/.git_completion ]] && . ~/.git_completion
159
160 # is or is not
161 [[ -f ~/.bash_is ]] && . ~/.bash_is
162
163 # jump to directories
164 [[ -f ~/.bash_marks ]] && . ~/.bash_marks
165
166 # tmux completion script
167 [[ -f ~/.bash_tmux ]] && . ~/.bash_tmux
168
169 # jump completion script
170 [[ -f ~/.bash_compl ]] && . ~/.bash_compl
171
172 # jump completion script
173 [[ -f ~/.bash_base64 ]] && . ~/.bash_base64
174
175 # emacs launcher script
176 [[ -f ~/.bash_emacs ]] && . ~/.bash_emacs
177
178 # memo
179 [[ -f ~/.bash_memo ]] && . ~/.bash_memo
180
181 # custom bindings
182 [[ -f ~/.bash_bind ]] && . ~/.bash_bind
183
184 # custom filters
185 [[ -f ~/.bash_filters ]] && . ~/.bash_filters
186
187 # openssl
188 [[ -f ~/.bash_openssl ]] && . ~/.bash_openssl
189
190 # pomodoro
191 [[ -f ~/.bash_pomodoro ]] && . ~/.bash_pomodoro
192
193 # django
194 [[ -f ~/.bash_django ]] && . ~/.bash_django
195
196 # nginx
197 [[ -f ~/.bash_nginx ]] && . ~/.bash_nginx