#!/bin/sh

# Default stuff
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_BIN_HOME="$HOME/.local/bin"

# Default Programs
export EDITOR="nvim"
export VISUAL="nvim"
export TERMINAL="alacritty"
export BROWSER="surf-open"

export PATH="$XDG_DATA_HOME/gem/bin:$PATH"
export PATH="$XDG_BIN_HOME:$PATH"
export PATH="/opt/appimages/:$PATH"

export GPG_TTY=$(tty)

export _JAVA_AWT_WM_NONREPARENTING=1
export ANDROID_SDK_ROOT="$HOME/.local/share/Android/Sdk"

# TODOTXT STUFF
export TODOTXT_DEFAULT_ACTION=ls
export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n'

# ~/ clean-up
export ZPLUG_HOME="$XDG_CONFIG_HOME/zsh/zplug"
export MPD_HOST="$XDG_RUNTIME_DIR/mpd_socket"
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
export SSH_ASKPASS=ssh-askpass
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export GEM_HOME="$XDG_DATA_HOME"/gem
export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem
#export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
export WGETRC="$XDG_CONFIG_HOME/wgetrc"
mkdir -p "$XDG_DATA_HOME"/wineprefixes
export WINEPREFIX="\"$XDG_DATA_HOME\"/wineprefixes/default\""
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
mkdir -p "$XDG_CACHE_HOME"/less
export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey
export LESSHISTFILE="$XDG_CACHE_HOME"/less/history
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
export CRAWL_DIR="$XDG_DATA_HOME"/crawl
export CCACHE_CONFIGPATH="$XDG_CONFIG_HOME"/ccache.config
export CCACHE_DIR="$XDG_CACHE_HOME"/ccache
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android
export ANDROID_AVD_HOME="$XDG_DATA_HOME"/android
export ANDROID_EMULATOR_HOME="$XDG_DATA_HOME"/android
export ADB_VENDOR_KEY="$XDG_CONFIG_HOME"/android
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export HISTFILE="$XDG_DATA_HOME"/bash/history
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export XMONAD_CONFIG_HOME="$XDG_CONFIG_HOME"/xmonad
export XMONAD_DATA_HOME="$XDG_DATA_HOME"/xmonad
export XMONAD_CACHE_HOME="$XDG_CACHE_HOME"/xmonad
export ZDOTDIR="$XDG_CONFIG_HOME"/zsh
export ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl"
export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc
export VSCODE_PORTABLE="$XDG_DATA_HOME"/vscode

# ~/ alias clean-ups
alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget-hsts\""
alias irssi="irssi --config=\"$XDG_CONFIG_HOME\"/irssi/config
--home=\"$XDG_DATA_HOME\"/irssi"
alias lynx="lynx -cfg=$XDG_CONFIG_HOME/lynx/lynx.cfg"
alias monerod="monerod --data-dir \"$XDG_DATA_HOME\"/bitmonero"

# Useful aliases
alias ls="ls --color=auto"
alias lf="lfub"
alias config="/usr/bin/git --git-dir=$HOME/.config/dotfiles --work-tree=$HOME"
alias update="sudo mount /dev/sda1 /boot && sudo pacman -Syu" # fix this
alias pman="pacman"
alias cleanup_packages='(set -x; sudo pacman -R $(pacman -Qdtq))'
alias myip="curl ipinfo.io/ip"
alias cp="cp -iv"
alias mv="mv -iv"
alias rm="rm -v"
alias g="git"
alias gph="git push"
alias gpl="git pull"
alias gc="git commit"
alias f="$FILE"
alias e="$EDITOR"
alias v="$EDITOR"
alias ll="ls -lhA"
alias ..="cd .."
alias t="todo.sh"
