hwinfo package to detect hw info.
[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 PS1=$'\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n\u21D2 '
67 else
68 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n > '
69 fi
70 else
71 #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") \$ '
72 if [ $USER='nsukami']; then
73 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) > '
74 PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) \n > '
75 else
76 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) \n > '
77 fi
78
79 fi
80 unset color_prompt force_color_prompt
81
82 # If this is an xterm set the title to user@host:dir
83 case "$TERM" in
84 xterm*|rxvt*)
85 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w $(vcprompt -f %b%a%m%u) \a\]$PS1"
86 ;;
87 *)
88 ;;
89 esac
90
91 # enable color support of ls
92 if [ -x /usr/bin/dircolors ]; then
93 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
94 alias ls='ls --color=auto'
95 fi
96
97
98
99 # enable programmable completion features (you don't need to enable
100 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
101 # sources /etc/bash.bashrc).
102 if ! shopt -oq posix; then
103 if [ -f /usr/share/bash-completion/bash_completion ]; then
104 . /usr/share/bash-completion/bash_completion
105 elif [ -f /etc/bash_completion ]; then
106 . /etc/bash_completion
107 fi
108 fi
109
110 # start gpg agent
111 # be sure to have done apt install gpg-agent pinentry-curses first
112 eval `gpg-agent --daemon`
113
114 # Alias definitions.
115 # You may want to put all your additions into a separate file like
116 # ~/.bash_aliases, instead of adding them here directly.
117 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
118 [[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
119
120 # git completion
121 [[ -f ~/.git_completion ]] && . ~/.git_completion
122
123 # personal customization
124 [[ -f ~/.bash_customization ]] && . ~/.bash_customization
125
126 # personal functions
127 [[ -f ~/.bash_function ]] && . ~/.bash_function
128
129 # personal export
130 [[ -f ~/.bash_export ]] && . ~/.bash_export
131
132 # personal color
133 [[ -f ~/.bash_color ]] && . ~/.bash_color
134
135 # personal shopt
136 [[ -f ~/.bash_shopt ]] && . ~/.bash_shopt
137
138 # git completion
139 [[ -f ~/.git_completion ]] && . ~/.git_completion
140
141 # is or is not
142 [[ -f ~/.bash_is ]] && . ~/.bash_is
143
144 # jump to directories
145 [[ -f ~/.bash_marks ]] && . ~/.bash_marks
146
147 # tmux completion script
148 [[ -f ~/.bash_tmux ]] && . ~/.bash_tmux
149
150 # jump completion script
151 [[ -f ~/.bash_compl ]] && . ~/.bash_compl
152
153 # jump completion script
154 [[ -f ~/.bash_base64 ]] && . ~/.bash_base64
155
156 # emacs launcher script
157 [[ -f ~/.bash_emacs ]] && . ~/.bash_emacs
158
159 # memo
160 [[ -f ~/.bash_memo ]] && . ~/.bash_memo
161
162 # custom bindings
163 [[ -f ~/.bash_bind ]] && . ~/.bash_bind
164
165 # custom filters
166 [[ -f ~/.bash_filters ]] && . ~/.bash_filters
167
168 # if autoenv is present
169 # usage:
170 # $ touch project/.env
171 # $ echo "echo 'woah'" > project/.env
172 # $ cd project
173 # woah
174 [[ -f ~/.autoenv/activate.sh ]] && . ~/.autoenv/activate.sh
175
176 # print available tmux sessions if available
177 tmux list-sessions 2> /dev/null
178
179 # always put prompt at bottom
180 # PS1="\[$(tput cup "$LINES")\]"$PS1
181
182
183 # if [ -z "$VIRTUAL_ENV" ]; then
184 # PS1="$VIRTUAL_ENV"'\[\e[$LINES;1H\]'$PS1
185 # else
186 # PS1='\[\e[$LINES;1H\]'$PS1
187 # fi