### Debug

# In case the config is buggy, set TR_NO_SHELL_CONFIG before sourcing it to
# disable it

if [ -n "$TR_NO_SHELL_CONFIG" ]
then
    echo "Not loading Bash profile"
    return 0
fi

### Environment variables

# Set important directories

export DOTFILES_DIR="$HOME/dotfiles"
export XDG_CONFIG_HOME="$HOME/.config"

# Make sure they exist

mkdir -p "$DOTFILES_DIR" "$XDG_CONFIG_HOME"

# Rest of the environment

export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
export LC_TIME='fr_FR.UTF-8'
export GRIM_DEFAULT_DIR="$HOME/images/screenshots"
export MOZ_ENABLE_WAYLAND=1
export PASSWORD_STORE_CLIP_TIME=120
export SUDO_EDITOR="emacs -q -nw -l $DOTFILES_DIR/emacs/core.el"
export EDITOR="emacs -q -nw -l $DOTFILES_DIR/emacs/core.el"
export SUDO_EDITOR="$EDITOR"
export MANWIDTH=80

### Add personal executable files to the PATH

if [ -d "$HOME/.local/bin" ]
then
    export PATH="$PATH:$HOME/.local/bin"
fi

### Load Bashrc, even if the shell is not interactive

if [ -n "$PS1" -a -z "$BASHRC_LOADED" ]
then
    source "$DOTFILES_DIR/shell/bashrc"
fi

# Local Variables:
# mode: sh
# End:
