add xdg env check

This commit is contained in:
Tomasz Kapias 2023-03-19 15:38:34 +07:00
parent ac5ce1fbe6
commit 6a15c81069
Signed by: tkapias
SSH key fingerprint: SHA256:bsmasrX7y0xxAHa/x1x8zAgHInO4nPpKMk5JIQ0Vsbw

View file

@ -23,6 +23,7 @@ if [[ -d "$HOME/.local/bin" ]] ; then
fi
# Check if XDG environment variables are set or set them to default
if command -v xdg-user-dir 1> /dev/null; then
if [[ -z "$XDG_DATA_HOME" ]]; then
export XDG_DATA_HOME=$HOME/.local/share
fi
@ -44,6 +45,7 @@ else
XDG_DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)"
export XDG_DOWNLOAD_DIR
fi
fi
# ==============================
# Shell