manager/config/bash/bashrc

21 lines
854 B
Bash

# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# == Add personal bin directory to PATH
if [ -d ${HOME}/.local/bin ]; then
export PATH=${HOME}/.local/bin:${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
# == 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