dotfiles/run/.bash_profile

55 lines
1.3 KiB
Bash
Raw Normal View History

# If not running interactively, don't do anything!
[[ $- != *i* ]] && return
2017-02-27 06:49:09 +00:00
# Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0)
READLINK=$(which greadlink || which readlink)
CURRENT_SCRIPT=$BASH_SOURCE
if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then
SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT")
DOTFILES_DIR=$(dirname "$(dirname "$SCRIPT_PATH")")
elif [ -d "$HOME/.dotfiles" ]; then
DOTFILES_DIR="$HOME/.dotfiles"
else
echo "Unable to find dotfiles, exiting."
return # `exit 1` would quit the shell itself
fi
# Finally we can source the dotfiles (order matters)
for DOTFILE in "$DOTFILES_DIR"/system/.{function,,env,alias,prompt,vimrc}; do
[ -f "$DOTFILE" ] && . "$DOTFILE"
2017-02-26 04:12:13 +00:00
done
2017-02-27 06:49:09 +00:00
# Set LSCOLORS
eval "$(dircolors "$DOTFILES_DIR"/system/.dir_colors)"
# Hook for extra/custom stuff
EXTRA_DIR="$HOME/.extra"
if [ -d "$EXTRA_DIR" ]; then
for EXTRAFILE in "$EXTRA_DIR"/run/*.sh; do
[ -f "$EXTRAFILE" ] && . "$EXTRAFILE"
done
fi
# BEGIN ANSIBLE MANAGED BLOCK
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh
fi
# Clean up
unset READLINK CURRENT_SCRIPT SCRIPT_PATH DOTFILE
# Export
export OS DOTFILES_DIR EXTRA_DIR