+# User wants us to check if there is a tmpfs mounted for them
+# (say /run/user/$uid), and if so, point TMPDIR there. We use
+# a subdir there to avoid interfering with other stuff
+if zstyle -T ':ganneff:config' runtmp; then
+ rudir="$(df -t tmpfs --output=target|grep ${UID} || true)/tmp"
+fi
+
+# Ignore existing TMPDIR variable and always repoint...
+if zstyle -T ':ganneff:config' resettmpdir; then
+ export TMPDIR="${rudir:-$HOME/tmp}"
+else
+ # ... or not
+ (( ${+TMPDIR} )) || export TMPDIR="${rudir:-$HOME/tmp}"
+fi
+