2020-03-07 01:49:13 +01:00
|
|
|
#
|
|
|
|
# ~/.dotfiles/profiles/main.sh
|
|
|
|
#
|
|
|
|
DOTFILES="$XDG_DOTFILES_DIR"
|
2016-10-06 03:21:13 +02:00
|
|
|
|
|
|
|
|
2020-03-07 01:49:13 +01:00
|
|
|
addpath() { case ":${PATH:=$1}:" in *:$1:*) ;; *) PATH="$1:$PATH" ;; esac; }
|
2016-09-26 15:40:04 +02:00
|
|
|
|
2020-03-07 01:49:13 +01:00
|
|
|
# add ~/.local/bin to PATH
|
2020-05-04 19:21:59 +02:00
|
|
|
if [ -d "$HOME/.local/bin" ]
|
2019-01-10 18:16:18 +01:00
|
|
|
then
|
2020-05-04 19:21:59 +02:00
|
|
|
addpath "$HOME/.local/bin"
|
2019-01-10 18:16:18 +01:00
|
|
|
fi
|
|
|
|
|
2020-03-07 01:49:13 +01:00
|
|
|
# add DOTFILES/bin to PATH
|
|
|
|
DOTBIN="$DOTFILES/bin"
|
|
|
|
if [ -d "$DOTBIN" ]
|
|
|
|
then
|
|
|
|
addpath "$DOTBIN"
|
|
|
|
fi
|
2016-09-26 15:40:04 +02:00
|
|
|
|
2020-03-07 01:49:13 +01:00
|
|
|
# use vi(m) if possible
|
2016-09-26 15:40:04 +02:00
|
|
|
export EDITOR="vi"
|
2020-03-07 01:49:13 +01:00
|
|
|
export VISUAL="vi"
|
2016-09-26 15:40:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Source Envs
|
2016-10-06 03:21:13 +02:00
|
|
|
DOTENVS="$DOTFILES/envs.d"
|
|
|
|
if [ -d "$DOTENVS" ]
|
|
|
|
then
|
|
|
|
for f in "$DOTENVS/*.active"
|
|
|
|
do
|
|
|
|
if [ "$f" = "$DOTENVS/*.active" ]
|
|
|
|
then
|
|
|
|
break
|
|
|
|
fi
|
2016-09-26 15:40:04 +02:00
|
|
|
|
2016-10-06 03:21:13 +02:00
|
|
|
source "$f"
|
|
|
|
done
|
|
|
|
fi
|
2016-09-26 15:40:04 +02:00
|
|
|
|
2020-03-07 01:49:13 +01:00
|
|
|
# if this is BASH source BASHRC
|
2022-02-10 20:07:37 +01:00
|
|
|
DOTBASHRC="$DOTFILES/bash/bashrc"
|
|
|
|
if [ "$BASH" ] && [ -r "$DOTBASHRC" ]
|
2016-10-06 03:21:13 +02:00
|
|
|
then
|
2022-02-10 20:07:37 +01:00
|
|
|
source "$DOTBASHRC"
|
2016-09-26 15:40:04 +02:00
|
|
|
fi
|
2022-02-10 20:07:37 +01:00
|
|
|
unset DOTBASHRC
|