mirror of
https://github.com/kastdeur/dotfiles.git
synced 2024-12-22 01:03:35 +01:00
46 lines
691 B
Bash
46 lines
691 B
Bash
#
|
|
# ~/.dotfiles/profiles/main.sh
|
|
#
|
|
DOTFILES="$XDG_DOTFILES_DIR"
|
|
|
|
|
|
addpath() { case ":${PATH:=$1}:" in *:$1:*) ;; *) PATH="$1:$PATH" ;; esac; }
|
|
|
|
# add ~/.local/bin to PATH
|
|
if [ -d "$HOME/.local/bin" ]
|
|
then
|
|
addpath "$HOME/.local/bin"
|
|
fi
|
|
|
|
# add DOTFILES/bin to PATH
|
|
DOTBIN="$DOTFILES/bin"
|
|
if [ -d "$DOTBIN" ]
|
|
then
|
|
addpath "$DOTBIN"
|
|
fi
|
|
|
|
# use vi(m) if possible
|
|
export EDITOR="vi"
|
|
export VISUAL="vi"
|
|
|
|
|
|
# Source Envs
|
|
DOTENVS="$DOTFILES/envs.d"
|
|
if [ -d "$DOTENVS" ]
|
|
then
|
|
for f in "$DOTENVS/*.active"
|
|
do
|
|
if [ "$f" = "$DOTENVS/*.active" ]
|
|
then
|
|
break
|
|
fi
|
|
|
|
source "$f"
|
|
done
|
|
fi
|
|
|
|
# if this is BASH source BASHRC
|
|
if [ "$BASH" ] && [ -f $DOTFILES/bash/rc ]
|
|
then
|
|
source $DOTFILES/bash/rc
|
|
fi
|