# General environment settings. export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export LANG="en_US.UTF-8" export LANGUAGE="en_US" export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" export LC_COLLATE="C" export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc" export LESS="-i -j.49 -M -R -z-2" export LESSHISTFILE="$XDG_DATA_HOME/less/history" export LESSHISTSIZE=1000 export LOCAL_PREFIX="/usr/local" export PAGER=less export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py" have() { command -v "$1" >/dev/null 2>&1 } # Prevent path_helper from messing with the PATH when starting tmux. # # Clearing PATH before path_helper executes (from /etc/profile) will prevent it # from prepending the default PATH to our (previously) chosen PATH, and will # allow the rest of this file to set up PATH and MANPATH correctly. # # For details see: https://superuser.com/a/583502 # [ "$(uname -s)" = "Darwin" ] && { PATH=""; source /etc/profile; } # Prepend $2 to variable $1 using $3 as separator, but only if $2 is not already # contained in $1. This is useful for prepending to PATH while avoiding # duplicates. prepend_unique() { local var="$1" local new="$2" local sep="${3-:}" # Default separator is colon. local old="${(P)var}" case "${sep}${old}${sep}" in *"${sep}${new}${sep}"*) # Skip duplicate. ;; "${sep}${sep}") # Variable was empty, set without separator. typeset -g $var="${new}" ;; *) # Prepend with separator. typeset -g $var="${new}${sep}${old}" ;; esac } # Add custom bin dirs to PATH if they exist and are not already in PATH. while read -r dir; do [ -d "$dir" ] && prepend_unique PATH "${dir}" done </dev/null 2>&1; then export DISPLAY="$xdisplay" export LIBGL_ALWAYS_INDIRECT=1 fi unset xdisplay fi