65 lines
1.8 KiB
Bash
65 lines
1.8 KiB
Bash
# .env
|
|
# vim: ft=zsh
|
|
#
|
|
# Environment settings for bash and derivatives. The env scripts are sources by
|
|
# Zsh for every shell, even the non-interactive ones, so this needs to be small
|
|
# and quick. Any configuration that will only be used for interactive sessions
|
|
# should be in the rc scripts.
|
|
#
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
[[ -e "$HOME/.shell-functions" ]] && source "$HOME/.shell-functions"
|
|
|
|
export SYS=`uname -s | tr A-Z a-z`
|
|
# Set this to a non-zero integer to see startup messages
|
|
export NOISY=0
|
|
|
|
print_heading -l 1 'Initializing environment'
|
|
|
|
PAGER="less"
|
|
MANPAGER=$PAGER
|
|
EDITOR="vim"
|
|
VISUAL=$EDITOR
|
|
LESSHISTFILE="-"
|
|
GREP_OPTIONS="--color=auto"
|
|
GREP_COLOR="1;32"
|
|
|
|
export PAGER MANPAGER \
|
|
EDITOR VISUAL \
|
|
LESSHISTFILE \
|
|
GREP_OPTIONS GREP_COLOR
|
|
|
|
path=("/usr/local/bin" "/usr/bin" "/bin" "/usr/local/sbin" "/usr/sbin" "/sbin")
|
|
# NOTE: These prepended to $PATH in reverse order, so $HOME/bin will end up
|
|
# being the first path component.
|
|
[[ -d "/usr/X11/bin" ]] && path+=("/usr/X11/bin")
|
|
[[ -d "/opt/local/bin" ]] && path=("/opt/local/bin" $path)
|
|
[[ -d "$HOME/.local/bin" ]] && path=("$HOME/.local/bin" $path)
|
|
[[ -d "$HOME/bin" ]] && path=("$HOME/bin" $path)
|
|
|
|
export path
|
|
|
|
if which virtualenvwrapper.sh 1>/dev/null 2>&1; then
|
|
export WORKON_HOME="$HOME/src/py/.envs"
|
|
source `which virtualenvwrapper.sh`
|
|
fi
|
|
|
|
export GPG_TTY=`tty`
|
|
|
|
# System-specific settings
|
|
if [[ -e "$HOME/.env.$SYS" ]]; then
|
|
print_info -l 2 "Sourcing system-specific environment settings for $SYS"
|
|
source "$HOME/.env.$SYS"
|
|
fi
|
|
|
|
host_env="$HOME/.env.`hostname -s`"
|
|
if [[ -e "$host_env" ]]; then
|
|
print_info -l 2 "Sourcing host-specific environment settings: $host_env"
|
|
source "$host_env"
|
|
fi
|
|
|
|
# Local environment settings
|
|
if [[ -e "$HOME/.env.local" ]]; then
|
|
print_info -l 2 "Sourcing local environment setup"
|
|
source "$HOME/.env.local"
|
|
fi
|