Skip to content

Commit

Permalink
Move all environment vars to a 'new' .profile file
Browse files Browse the repository at this point in the history
  • Loading branch information
babab committed Feb 25, 2016
1 parent d96375e commit 9733931
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 44 deletions.
1 change: 1 addition & 0 deletions dotfiles.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.config
.gitconfig
.gitignore_global
.profile
.ps1_basic
.ps1_ext
.pythonrc
Expand Down
35 changes: 2 additions & 33 deletions dotfiles/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,14 @@ shopt -s checkwinsize

set -o vi

addtopath()
{
# Add dirs to $PATH; checks if dir exists and is not already in $PATH
(test ! "$1" || test ! -d "$1") && return 1
found=0
for i in $(echo "${PATH}" | sed 's/:/\n/g'); do
if [ "$1" == "$i" ]; then
found=1
fi
done
if [ ${found} -eq 0 ]; then
export PATH="${PATH}:$1"
fi
}

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

if [ -d "/usr/local/go" ]; then
export GOROOT=/usr/local/go
addtopath "$GOROOT/bin"
fi

addtopath "$HOME/bin"
addtopath "/var/lib/gems/1.8/bin"

if [ -x /usr/bin/scrot ]; then
if [ ! -d "$HOME/Pictures/scrot" ]; then
mkdir -p "$HOME/Pictures/scrot"
Expand All @@ -49,17 +30,8 @@ fi
# Source aliases
. $HOME/.aliases

# Environment vars
export DISPASS_LABELFILE=~/.dispass
export EDITOR="/usr/bin/vim"
export EXEC_FOR_PYTHON="python2"
export GPG_TTY="$(tty)"
export LESS="iFXRS"
export PYTHONSTARTUP=~/.pythonrc

if [ ! -z "${SSH_CONNECTION}" ]; then
export TERM=screen
fi
# Source environment variables
. $HOME/.profile

# Wrapper for starting the Django development server on varying
# addresses and port numbers. Allowing to also run if manage.py is in
Expand Down Expand Up @@ -124,6 +96,3 @@ complete -ac loop
if [ -f "$HOME/.bashrc.local" ]; then
. ${HOME}/.bashrc.local
fi

# Check date, one of my boxes has a broken clock battery
test $(date +%s) -lt 1366700000 && echo Date is incorrect, fix it!
15 changes: 15 additions & 0 deletions dotfiles/.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Environment vars
export BROWSER="/usr/bin/firefox"
export DISPASS_LABELFILE=~/.dispass
export EDITOR="/usr/bin/vim"
export EXEC_FOR_PYTHON="python2"
export GPG_TTY="$(tty)"
export LANG=en_US.UTF-8
export LESS="iFXRS"
export PATH="$HOME/bin:$PATH:$HOME/usr/bin:$HOME/.gem/ruby/2.2.0/bin"
export PYTHONSTARTUP=~/.pythonrc
export VIRTUAL_ENV_DISABLE_PROMPT=disabled

if [ ! -z "${SSH_CONNECTION}" ]; then
export TERM=screen
fi
13 changes: 2 additions & 11 deletions dotfiles/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ autoload -U colors && colors
fpath=(~/.zsh/functions $fpath)
autoload -U ~/.zsh/functions/*(:t)

### Aliases ##################################################################
source ${HOME}/.aliases
source ${HOME}/.aliases # aliases and (wrapper) functions
source ${HOME}/.profile # environment variables

if [ -x /usr/bin/scrot ]; then
if [ ! -d "$HOME/Pictures/scrot" ]; then
Expand All @@ -23,15 +23,6 @@ if [ -x /usr/bin/scrot ]; then
alias wscrot="scrot '$HOME/Pictures/scrot/%s_%Y-%m-%d_\$wx\$h.png'"
fi

### Environment variables ####################################################
export BROWSER="/usr/bin/firefox"
export EDITOR="/usr/bin/vim"
export EXEC_FOR_PYTHON="python2"
export LANG=en_US.UTF-8
export LESS="iFXRS"
export PATH="$HOME/bin:$PATH:$HOME/usr/bin:$HOME/.gem/ruby/2.2.0/bin"
export VIRTUAL_ENV_DISABLE_PROMPT=disabled

### Custom functions #########################################################

# Wrapper for starting the Django development server on varying
Expand Down

0 comments on commit 9733931

Please sign in to comment.