#
#  █             █
#  █   ▄   ▄▄▄   █ ▄▄    ▄ ▄▄   ▄▄▄
#  █ ▄▀   █   ▀  █▀  █   █▀  ▀ █▀  ▀
#  █▀█     ▀▀▀▄  █   █   █     █
#  █  ▀▄  ▀▄▄▄▀  █   █   █     ▀█▄▄▀
#
#
#  welcome to my shell configuration
#
#  http://github.com/mitchweaver/dots
#
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

# stop .core file generation
ulimit -c 0

umask 022

# -*-*- Options -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
SHELLRC_DIR=~/src/dots/shell
# PS1_STYLE=pwd-no-prompt  # [user-pwd/user/pwd/user-host-pwd]
PS1_STYLE=user-host-pwd  # [user-pwd/user/pwd/user-host-pwd]
# PS1_STYLE=user-pwd       # [user-pwd/user/pwd/user-host-pwd]
# PS1_STYLE=pwd            # [user-pwd/user/pwd/user-host-pwd]
PS1_GIT=true             # [true/false]

HISTORY_STYLE=default      # [default/per-shell]
export HISTSIZE=300
export HISTFILE="${HOME}/.ksh_history"
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

if [ -d "${SHELLRC_DIR}" ] ; then

    # OpenBSD
    if command -v pkg_add >/dev/null ; then
        . "${SHELLRC_DIR}/openbsd.shellrc"
    # Everything Else
    elif command -v emerge >/dev/null ; then
            . "${SHELLRC_DIR}/gentoo.shellrc"
        elif command -v dnf >/dev/null ; then
            . "${SHELLRC_DIR}/redhat.shellrc"
        elif command -v apk >/dev/null ; then
            . "${SHELLRC_DIR}/alpine.shellrc"
        elif command -v freebsd-update >/dev/null ; then
            . "${SHELLRC_DIR}/freebsd.shellrc"
        elif command -v brew >/dev/null ; then
            . "${SHELLRC_DIR}/macos.shellrc"
        if [ -d /proc ] ; then
            . "${SHELLRC_DIR}/linux.shellrc"
            if command -v docker >/dev/null ; then
                . "${SHELLRC_DIR}/docker.shellrc"
            fi
        fi
        if command -v zfs >/dev/null ; then
            . "${SHELLRC_DIR}/zfs.shellrc"
        fi
        if command -v ollama >/dev/null ; then
            . "${SHELLRC_DIR}/ai.shellrc"
        fi
    fi

    . "${SHELLRC_DIR}/builtins.shellrc"
    . "${SHELLRC_DIR}/development.shellrc"
    . "${SHELLRC_DIR}/doas.shellrc"
    . "${SHELLRC_DIR}/generic_aliases.shellrc"
    . "${SHELLRC_DIR}/generic_functions.shellrc"
    . "${SHELLRC_DIR}/history.shellrc"
    . "${SHELLRC_DIR}/movement.shellrc"
    . "${SHELLRC_DIR}/networking.shellrc"
    . "${SHELLRC_DIR}/options.shellrc"
    . "${SHELLRC_DIR}/prompt.shellrc"
    . "${SHELLRC_DIR}/templates.shellrc"
    . "${SHELLRC_DIR}/wasteland.shellrc"

    unset release
    unset SHELLRC_DIR
fi

