+# install location and source files
+: ${DEST:=$(realpath "$HOME")}
+: ${SRC:=$(dirname "$(realpath "$0")")}
+
+# confirm XDG vars we care about are set up
+: ${LOCAL:=.local} # NOTE: needed for bin, which has no xdg var
+: ${XDG_DATA_HOME:=$DEST/$LOCAL/share}
+: ${XDG_CONFIG_HOME:=$DEST/.config}
+: ${XDG_STATE_HOME:=$DEST/$LOCAL/state}
+: ${XDG_CACHE_HOME:=$DEST/.cache}
+
+# these are the vars we actually use
+share="${XDG_DATA_HOME#$DEST/}"
+etc="${XDG_CONFIG_HOME#$DEST/}"
+state="${XDG_STATE_HOME#$DEST/}"
+cache="${XDG_CACHE_HOME#$DEST/}"
+
+# test
+devnull=/dev/null
+if [ "${DOTFILES_TEST+x}" = x ]; then
+ echo "Running test -- no changes will be applied"
+ devnull=/dev/stdout
+ _cd() {
+ echo "-- cd $PWD --> $*";
+ cd $*;
+ }
+ alias cd="_cd"
+ alias mkdir="echo -- mkdir"
+ alias rmdir="echo -- rmdir"
+ alias ln="echo -- ln"
+ alias rm="echo -- rm"
+ alias mv="echo -- mv"
+ alias sh="echo -- sh"