#!/bin/sh

export EDITOR="nvim"
export TERMINAL="alacritty"
export TERMINAL_PROG="alacritty"
export BROWSER="brave"

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"

export XAUTHORITY=/tmp/Xauthority # This causes other window managers to break, who cares anyways?
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
# export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export KODI_DATA="$XDG_DATA_HOME/kodi"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
#export LESSHISTFILE="-"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export MANPAGER='nvim +Man!'
# export QT_QPA_PLATFORMTHEME="gtk2"	# Have QT use gtk2 theme.
export __GL_SHADER_DISK_CACHE_PATH=~/.cache/
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
export PYTHON_HISTORY="$XDG_STATE_HOME/python_history"
export JUPYTER_PLATFORM_DIRS="$XDG_CONFIG_HOME/jupyter"
export MYSQL_HISTFILE="$XDG_CACHE_HOME/.mariadb_history"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"

# Other program settings
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export ANDROID_HOME="$HOME/Android/Sdk/"
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export NPM_CONFIG_USERCONFIG="$HOME/.config/npm/npmrc"
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history

# Adds `~/.local/bin` to $PATH
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
# export PATH=$PATH:$HOME/.local/bin
export PATH=$PATH:$HOME/.local/pbin # private bin
export PATH="$PATH:$XDG_DATA_HOME/cargo/bin"

# Start graphical server on user's current tty if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
