27 lines
1 KiB
Bash
27 lines
1 KiB
Bash
# If not running interactively, don't do anything
|
|
[[ $- != *i* ]] && return
|
|
|
|
# == Add personal bin directory to PATH
|
|
if ! [[ "${PATH}" =~ "${HOME}/.local/bin" ]]; then
|
|
export PATH=${HOME}/.local/bin:${PATH}
|
|
fi
|
|
|
|
# == Add custom scripts directory to PATH
|
|
if ! [[ "${PATH}" =~ "${HOME}/.local/scripts" ]]; then
|
|
export PATH=${HOME}/.local/scripts:${PATH}
|
|
fi
|
|
|
|
export XDG_CONFIG_HOME=${HOME}/.local/config
|
|
export XDG_DATA_HOME=${HOME}/.local/share
|
|
export XDG_CACHE_HOME=${HOME}/.local/cache
|
|
export XDG_STATE_HOME=${HOME}/.local/state
|
|
export LOG_HOME="${XDG_STATE_HOME}/logs"
|
|
|
|
# == load all enabled scripts in ~/.bashrc.d
|
|
# == any scripts with the .disabled extension won't be loaded
|
|
for f in $(find ${XDG_CONFIG_HOME}/bash/bashrc.d -mindepth 1 -maxdepth 1 -type f -not -iname *.disabled | sort); do source $f; done
|
|
|
|
# == Run tmux in the default session whenever a terminal session starts
|
|
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
|
|
exec tmux new-session -A -s main
|
|
fi
|