#!/bin/sh
#                             _             _     
#                            | |           | |    
#   _____  ___ __   ___  _ __| |_ ___   ___| |__  
#  / _ \ \/ / '_ \ / _ \| '__| __/ __| / __| '_ \ 
# |  __/>  <| |_) | (_) | |  | |_\__ \_\__ \ | | |
#  \___/_/\_\ .__/ \___/|_|   \__|___(_)___/_| |_|
#           | |                                   
#           |_|                                   
#
# Pablo (C) 2023
# 
# File that contains all environmet variables I use. This can be sourced from,
# bash, fish, sh, zsh, etc.

# Configre XDG stuff
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"

# Configure the MANPATH variable
export MANPATH="/usr/share/man"
export MANPATH="$MANPATH:/usr/local/man"
export MANPATH="$MANPATH:/usr/share/man"
export MANPATH="$MANPATH:$XDG_DATA_HOME/man"
export MANPATH="$MANPATH:$XDG_DATA_HOME/fzf/man"

export LIBRARY_PATH="/usr/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/lib:$LD_LIBRARY_PATH"

export DOTFILES_REPO="$XDG_DATA_HOME/dotfiles-repo"
export DOTFILES_LIST="$XDG_CONFIG_HOME/dotfiles.list"

# =========================== Programming Languages ==========================

# C
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# Rust
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"

# OCaml
export OPAMROOT="$XDG_DATA_HOME/opam"

# Ruby
export GEM_HOME="$XDG_DATA_HOME/gem"
export GEM_SPEC_CACHE="$XDG_CACHE_HOME/gem"
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME/bundle"
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME/bundle"
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle"
export DEBIAN_DISABLE_RUBYGEMS_INTEGRATION="true"

# Libraries for the Go programming language
export GOPATH="$XDG_DATA_HOME/go"

# Racket
export PLTUSERHOME="$XDG_DATA_HOME/racket"

# JS
export DENO_INSTALL="$XDG_DATA_HOME/deno"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history

# Wasmtime
export WASMTIME_HOME="$XDG_DATA_HOME/wasmtime"

# Julia
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
export JULIA_HISTORY="$XDG_CONFIG_HOME/julia/history"

# SageMath
export DOT_SAGE="$XDG_CONFIG_HOME/sage"

# Elm
export ELM_HOME="$XDG_CACHE_HOME/elm"

# ================================ Programs ==================================

# Bash history
export HISTFILE="$XDG_DATA_HOME/bash/history"

# GTK 2
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"

# gpg
export GNUPGHOME="$XDG_DATA_HOME/gnupg"

# readline
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"

# less history cache
export LESSKEY="$XDG_CONFIG_HOME/less/lesskey"
export LESSHISTFILE="$XDG_CACHE_HOME/less/history"

# wget
export WGETRC="$XDG_CONFIG_HOME/wgetrc"

# TeXLive
export TEXMFHOME="$XDG_DATA_HOME/texmf"
export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"
export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive/texmf-config"

# notmuch
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc
export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug

# pass(1)
export PASSWORD_STORE_DIR="$XDG_CONFIG_HOME"/password-store

# Jupyter notebook
export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter

# mplayer(1)
export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer

# aspell
export ASPELL_CONF="home-dir $XDG_CONFIG_HOME/aspell/"

# isync
export MBSYNCRC="$XDG_CONFIG_HOME/isync/mbsyncrc"

# SQLite
export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"

# cowsay cowthink
export COWPATH="/usr/local/share/cows:/usr/share/cows:$XDG_DATA_HOME/cows"

# Configure the PATH variable
export PATH="/usr/local/sbin" 
export PATH="$PATH:/usr/local/bin" 
export PATH="$PATH:/usr/sbin" 
export PATH="$PATH:/usr/bin" 
export PATH="$PATH:/sbin" 
export PATH="$PATH:/bin" 
export PATH="$PATH:/usr/lib/gnupg/" 
export PATH="$PATH:/usr/lib/gnupg2/" 
export PATH="$PATH:$HOME/.local/bin" 
export PATH="$PATH:/usr/bin/vendor_perl" 
export PATH="$PATH:$CARGO_HOME/bin" 
export PATH="$PATH:$GOPATH/bin" 
export PATH="$PATH:$DENO_INSTALL/bin" 
export PATH="$PATH:$XDG_DATA_HOME/npm/bin" 
export PATH="$PATH:$XDG_DATA_HOME/fzf/bin" 
export PATH="$PATH:$HOME/.cabal/bin" 
export PATH="$PATH:$GEM_HOME/ruby/3.0.0/bin"
export PATH="$PATH:$HOME/.elan/bin"

# Default programs
export TERMINAL="alacritty"
export EDITOR="nvim"
export GIT_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
export PAGER="less"
export BROWSER="firefox"

