forked from Belgarion/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
122 lines (96 loc) · 3.82 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
UNAMES=`uname -s`
export UNAMES
echo $LANG | 'grep' -i utf >/dev/null && UTF8=1 || UTF8=0
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
shopt -s cmdhist
set -o noclobber #prevent overwriting files with > (use >| if you want to overwrite)
set -o notify #notify job status direct instead of before next prompt
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$chroot" ] && [ -r /etc/gentoo_chroot ]; then
chroot=$(cat /etc/gentoo_chroot)
fi
if [[ ${EUID} == 0 ]]; then
USERCOLOR="\e[1;31m"
elif [[ `hostname` == "Belgarion" ]]; then
USERCOLOR="\e[1;36m"
elif [[ "${UNAMES%_*}" == "CYGWIN" ]]; then
USERCOLOR="\e[0;32m"
else
USERCOLOR="\e[1;33m"
fi
if [[ $UTF8 -eq 1 ]]; then
PS1='\[\e[1;30m\]┐ ${chroot:+(\[\e[1;32m\]$chroot\[\e[1;30m\]) }('${USERCOLOR}'\u\[\e[1;30m\]@\[\e[0;36m\]\h\[\e[1;30m\]) [\[\e[1;36m\]\t\[\e[0;36m\]\[\e[6D:\]\[\e[2C:\]\[\e[2C\]\[\e[1;30m\]|\[\e[0;36m\]\d\[\e[1;30m\]] [\[\e[0;36m\]`_bashish_prompt_cwd "\[\e[1;30m\]" "\[\e[0;36m\]" 58`\[\e[1;30m\]] \n\[\e[1;30m\]└\[\e[0;36m\]──\[\e[1;36m\]─>\[\e[0m\] '
else
PS1='\[\e[1;30m\]${chroot:+(\[\e[1;32m\]$chroot\[e[1;30m\]) }('$USERCOLOR'\u\[\e[1;30m\]@\[\e[0;36m\]\h\[\e[1;30m\]) [\[\e[1;36m\]\t\[\e[0;36m\]\[\e[6D:\]\[\e[2C:\]\[\e[2C\]\[\e[1;30m\]|\[\e[0;36m\]\d\[\e[1;30m\]] [\[\e[0;36m\]`_bashish_prompt_cwd "\[\e[1;30m\]" "\[\e[0;36m\]" 58`\[\e[1;30m\]] \n\[\e[1;36m\]>\[\e[0m\] '
fi
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*|screen*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
# Aliases
[ -f ~/.aliases ] && . ~/.aliases
#Configure screen
[ -f ~/.screenconf.sh ] && . ~/.screenconf.sh
[ -d ~/apps/bin ] && PATH=~/apps/bin:"${PATH}"
[ -d ~/bin ] && PATH=~/bin:"${PATH}"
[ -f ~/.bash_os-based ] && . ~/.bash_os-based
(which vimmanpager >&/dev/null) && export MANPAGER="vimmanpager"
if (which most >&/dev/null); then
export PAGER="most -s"
export BROWSER="most -s"
fi
[ -f ~/.sh/less_colors ] && . ~/.sh/less_colors
export LESS='-R -M --shift 5'
(which lesspipe.sh >&/dev/null) && export LESSOPEN='|lesspipe.sh %s'
export CONCURRENCY_LEVEL=3
export EDITOR="vim"
export GTK2_RC_FILES=$HOME/.gtkrc-2.0
export HISTFILE=/dev/null
export HISTIGNORE="fg"
export MOZ_DISABLE_PANGO=1
export MPD_HOST="[email protected]"
# Colorful message
which toilet >&/dev/null && toilet --gay "$UNAMES "
if [ -e ~/TODO ]; then
if [[ $SHLVL -eq 4 || $SHLVL -eq 5 ]]; then
echo tail ~/TODO -n5
tail ~/TODO -n5
fi
fi
#stty erase
stty -ixon # disable ^s ^x flow control
# Bash-completion
if [ -f /etc/profile.d/bash-completion ]; then
. /etc/profile.d/bash-completion
elif [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
if type keychain >&/dev/null; then
keychain ~/.ssh/id_rsa ~/.ssh/id_dsa
source ~/.keychain/${HOSTNAME}-sh
fi
[ -d /usr/local/bin ] && PATH="${PATH}":/usr/local/bin
[ -d /usr/local/sbin ] && PATH="${PATH}":/usr/local/sbin
# LUDD Paths
[ -d /software/mips-sde/06.61/bin ] && PATH="${PATH}":/software/mips-sde/06.61/bin
[ -d /usr/ccs/bin ] && PATH="${PATH}":/usr/ccs/bin
[ -d /usr/ccs/sbin ] && PATH="${PATH}":/usr/ccs/sbin
[ -d /opt/csw/bin ] && PATH="${PATH}":/opt/csw/bin
[ -d /opt/csw/sbin ] && PATH="${PATH}":/opt/csw/sbin