* `PS1`
* `SHORT_HOST`
* `TERM`
+* `XDG_RUNTIME_DIR`
* `XDG_CACHE_HOME`
* `ZSH_CACHE_DIR`
&& export LOCAL_HOME="/usr/local/home/$LOGNAME" \
|| export LOCAL_HOME="$HOME"
-# Setup XDG cache directory
-export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
-mkdir -p "$XDG_CACHE_HOME"
-
-# Setup ZSH cache directory
-export ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
-mkdir -p "$ZSH_CACHE_DIR"
-
# Update PATH to include directories inside of the $HOME directory
typeset -U path
for dir in ~/bin ~/sbin ~/Applications; do
--- /dev/null
+# AX-ZSH: Alex' Modular ZSH Configuration
+# 30_env.zprofile: Setup environment
+
+# Setup XDG cache directory
+[[ -z "$XDG_CACHE_HOME" ]] && XDG_CACHE_HOME="$LOCAL_HOME/.cache"
+export XDG_CACHE_HOME
+mkdir -p "$XDG_CACHE_HOME"
+
+# Setup XDG runtime directory
+[[ -z "$XDG_RUNTIME_DIR" ]] && XDG_RUNTIME_DIR="${TMPDIR:-/tmp/${UID}-runtime-dir}"
+export XDG_RUNTIME_DIR
+mkdir -p "$XDG_CACHE_HOME"
+
+# Setup ZSH cache directory
+[[ -z "$ZSH_CACHE_DIR" ]] && ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
+export ZSH_CACHE_DIR
+mkdir -p "$ZSH_CACHE_DIR"
--- /dev/null
+# AX-ZSH: Alex' Modular ZSH Configuration
+# 30_env.zshrc: Setup environment
+
+# Setup TMPDIR. Try to reset TMPDIR (when it is not set but TMP is), which is
+# common in tools like screen(1) because Linux removes some varibes for
+# "setgit" tools (see <https://bugzilla.redhat.com/show_bug.cgi?id=129682#c1>).
+# And therefore this has to be checked here, because inside of screen probably
+# no login shell is started ...
+[[ -z "$TMPDIR" && -n "$TMP" ]] && TMPDIR="$TMP"
+
+# Make sure TMP and TMPDIR become exported when they are set:
+[[ -n "$TMP" ]] && export TMP
+[[ -n "$TMPDIR" ]] && export TMPDIR