# Don't do anything if we are not running interactively.
case $- in
    *i*) ;;
    *) return ;;
esac

# Things todo only if we are in an X session.
if [ "${DISPLAY:-false}" != 'false' ]; then
    # Disable the system bell.
    /usr/bin/xset b off
fi

# Things todo only if we are connected to a TTY.
if [ -x /usr/bin/tty ] && /usr/bin/tty -s; then
    # Disable software flow control (Ctrl+s and Ctrl+q)
    if [ -x /usr/bin/stty ]; then
        /usr/bin/stty -ixon
    fi

    # Make sure gpg knows where to display a pinentry prompt.
    if GPG_TTY=$(/usr/bin/tty); then
        export GPG_TTY
    fi

    # Colors currently must come before aliases, we depend on $LS_COLORS.
    if [ -f "$CATLOAF_HOME"/etc/colorsrc ]; then
        source "$CATLOAF_HOME"/etc/colorsrc
    fi

    # Aliases don't get inhereted by subprocesses, gotta set them each interactive shell spawned.
    if [ -f "$CATLOAF_HOME"/etc/bash_aliases ]; then
        source "$CATLOAF_HOME"/etc/bash_aliases
    fi
fi

# 2024-01-03 - Alex - just use ssh-add to manage the keyring instead of setting this.
# export GIT_SSH_COMMAND="ssh -i $SSHKEY"

