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