#!/bin/zsh
typeset -U PATH path

# profile file. Runs on login. Environmental variables are set here.

# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.

# $HOME Clean-up
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
# export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"
export XDG_STATE_HOME="$HOME/.local/share"

export BUN_INSTALL="$XDG_DATA_HOME/bun"

# Adds `~/.local/bin` to $PATH
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
export PATH="$PATH:~/.spicetify"
export PATH="$PATH:${$(find ~/.local/share/bun/bin -type d -printf %p:)%%:}"
export PATH="$JAVA_HOME/bin:$PATH"
export PATH="$BUN_INSTALL/bin:$PATH"

# Disable files
export LESSHISTFILE=-
export $(dbus-launch)

export MANPAGER='nvim +Man!'

export LIBSEAT_BACKEND=logind

unsetopt PROMPT_SP

# Default Apps
export BROWSER="floorp"
export EDITOR="nvim"
export IMAGE="oculante"
export READER="zathura"
export TERMINAL="{{terminal}}"
export VIDEO="mpv"
export VISUAL="$EDITOR"
export WM="awesome"

export GTK_THEME=rose-pine-gtk


export HYPRSHOT_DIR="$HOME/Pictures/screenshots"

export ANDROID_HOME="$XDG_CONFIG_HOME/android"
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
export ANDROID_USER_HOME="$XDG_DATA_HOME/android"
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
export ELECTRUMDIR="$XDG_DATA_HOME/electrum"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GOPATH="$XDG_DATA_HOME/go"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
export HISTFILE="$XDG_DATA_HOME/history"
export HISTFILE="$XDG_STATE_HOME/bash/history"
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
export IPYTHONDIR="$XDG_CONFIG_HOME/ipython"
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter"
export KERAS_HOME="$XDG_DATA_HOME/keras"
export KODI_DATA="$XDG_DATA_HOME/kodi"
export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config"
export MYPY_CACHE_DIR="$XDG_CACHE_HOME/mypy"
export MYSQL_HISTFILE="$XDG_DATA_HOME/mysql_history"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
export NPM_CONFIG_USERCONFIG="$XDG_CACHE_HOME/npm/npmrc"
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
export PYTHONSTARTUP="$HOME/python/pythonrc"
export REDISCLI_HISTFILE="$XDG_DATA_HOME/redis/rediscli_history"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export RYE_HOME="$XDG_DATA_HOME/rye"
export SSB_HOME="$XDG_DATA_HOME/zoom"
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export UNISON="$XDG_DATA_HOME/unison"
export W3M_DIR="$XDG_DATA_HOME/w3m"
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
export XCURSOR_PATH="/usr/share/icons:$XDG_DATA_HOME/icons"
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
# export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java - Djavafx.cachedir=${XDG_CACHE_HOME}/openjfx"
# export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export JAVA_HOME="/usr/lib/jvm/java-21-openjdk"

# Other program settings
export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname
export DICS="/usr/share/stardict/dic/"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"
export LESS_TERMCAP_md="$(printf '%b' '[1;36m')"
export LESS_TERMCAP_me="$(printf '%b' '[0m')"
export LESS_TERMCAP_se="$(printf '%b' '[0m')"
export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')"
export LESS_TERMCAP_ue="$(printf '%b' '[0m')"
export LESS_TERMCAP_us="$(printf '%b' '[1;32m')"
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
# export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
# export QT_QPA_PLATFORMTHEME="gtk3" # Have QT use gtk3 theme.
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_SCREEN_SCALE_FACTORS="1;1"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm

. "$XDG_DATA_HOME/cargo/env"
. "$XDG_DATA_HOME/deno/env"
