dotfiles/shell/env
David Todd (c0de) 1bd9e76d6e New tmux startup system
The first running shell on the system should launch tmux automatically
Future shells being opened on the same system will not automatically launch tmux
It does not matter if you later detach from that initial session (you can rejoin with `ta`)
2018-05-16 19:25:15 -05:00

39 lines
1.1 KiB
Plaintext

# Skip all this for non-interactive shells
[[ -z "$PS1" ]] && return
# Force en_US UTF-8 environment
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# Paths
export PATH=$PATH:${HOME}/bin:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/bin
# Give the path to the dotfiles
export _DOTFILES="${HOME}/dotfiles"
# Allow automatic updates
export DISABLE_DOTFILES_AUTO_UPDATE="FALSE"
# Set "true" to update without asking first
export DISABLE_DOTFILES_UPDATE_PROMPT="FALSE"
# Update every 2 weeks (OMZ default)
export UPDATE_DOTFILES_DAYS=13
# Whether or not to automatically connect to a TMUX session when opening the shell
export DISABLE_TMUXAC="TRUE"
# If there is not an active tmux session, we probably want one
# Otherwise, the shell will not open the session again (eg. opening tabs, new terminals)
if $(tmux list-sessions >> /dev/null 2>&1); then
export TMUXATT="TRUE"
else
export TMUXATT="FALSE"
fi
# Automatically attach tmux session "C0DE"
if [[ -z "$TMUX" && "$TMUXATT" != "TRUE" && "$DISABLE_TMUXAC" != "FALSE" ]]; then
tmux attach -t C0DE || tmux new -s C0DE
fi