dotfiles/profiles/main.sh

49 lines
731 B
Bash
Raw Normal View History

#
# ~/.dotfiles/profiles/main.sh
#
DOTFILES="$XDG_DOTFILES_DIR"
addpath() { case ":${PATH:=$1}:" in *:$1:*) ;; *) PATH="$1:$PATH" ;; esac; }
# add ~/.local/bin to PATH
2020-05-04 19:21:59 +02:00
if [ -d "$HOME/.local/bin" ]
then
2020-05-04 19:21:59 +02:00
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
2022-02-10 20:07:37 +01:00
DOTBASHRC="$DOTFILES/bash/bashrc"
if [ "$BASH" ] && [ -r "$DOTBASHRC" ]
then
2022-02-10 20:07:37 +01:00
source "$DOTBASHRC"
fi
2022-02-10 20:07:37 +01:00
unset DOTBASHRC