Add workaround for XDG_RUNTIME_DIR on macOS

Buddy Sandidge 4 years ago
parent 3d8ce7e64f
commit 8ef95278ea

@ -10,6 +10,21 @@ export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"} export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"} export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
if [ "${XDG_RUNTIME_DIR}" = "" ]; then
__TMPDIR__=
__LINK__=/tmp/$(id -u)
if [ -L "${__LINK__}" ]; then
__TMPDIR__="$(readlink "${__LINK__}")"
else
__TMPDIR__="$(mktemp)"
ln -s "${__TMPDIR__}" "${__LINK__}"
fi
XDG_RUNTIME_DIR="${__TMPDIR__}"
unset __TMPDIR__ __LINK__
fi
export XDG_RUNTIME_DIR
env_file () { env_file () {
file="${1}" file="${1}"
if [ ! -f "${file}" ]; then if [ ! -f "${file}" ]; then

Loading…
Cancel
Save