#!/usr/bin/env bash

export LANG="en_GB.UTF-8"
export TERMINAL=/usr/local/bin/st
export TERM=xterm-256color
type -p nvim > /dev/null && export EDITOR="nvim" || export EDITOR="vim"
export READER='zathura'
export BROWSER="firefox-developer-edition"
export CDPATH=.:~:~/Projects:~/.dotfiles
export GOPATH="$HOME/go"
export NODE_PATH='/usr/lib/node_modules/'
export DOTREMINDERS="$HOME/.config/remind/remind.rem"

#Adds a list of all the sub directories in my .bin folder to a variable called mypath
mypath="$HOME/.bin"
# Adds sub folders in by .bin directory to the PATH
for d in "$HOME"/.bin/*/; do
    mypath+=":$d"
done

export PATH=~/Projects/current/bin:$mypath:$GOPATH/bin:$HOME/.local/share/bin:$PATH:.

#Ruby things
if type -p ruby > /dev/null; then
	GEM_HOME=$(ls -t -U | ruby -e 'puts Gem.user_dir')
	GEM_PATH=$GEM_HOME
	export PATH=$PATH:$GEM_HOME/bin
	export GEM_HOME=$(ruby -e 'print Gem.user_dir')
fi

export PATH=$PATH:$HOME/node_modules/.bin

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

export NOTMUCH_CONFIG="${XDG_CONFIG_HOME}/notmuch/config"

export LESS_TERMCAP_mb=$'\e[1;36m'
export LESS_TERMCAP_md=$'\e[1;36m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[1;40;92m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;32m'

export DOTFILES="$HOME/.dotfiles"

if [ -n "$GTK_MODULES" ]
then
  export GTK_MODULES="$GTK_MODULES:unity-gtk-module"
else
  export GTK_MODULES="unity-gtk-module"
fi

if [ -z "$UBUNTU_MENUPROXY" ]
then
  export UBUNTU_MENUPROXY=1
fi
