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
|
2019-01-10 18:16:18 +01:00
|
|
|
if [ -d "~/.local/bin" ]
|
|
|
|
then
|
|
|
|
addpath "~/.local/bin"
|
|
|
|
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
|
2016-10-11 23:18:39 +02:00
|
|
|
if [ "$BASH" ] && [ -f $DOTFILES/bash/rc ]
|
2016-10-06 03:21:13 +02:00
|
|
|
then
|
2016-10-11 23:18:39 +02:00
|
|
|
source $DOTFILES/bash/rc
|
2016-09-26 15:40:04 +02:00
|
|
|
fi
|