diff options
| -rw-r--r-- | .profile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/.profile b/.profile index 7a589d9..50b4e6d 100644 --- a/.profile +++ b/.profile @@ -3,10 +3,18 @@ if [ -z "${XDG_RUNTIME_DIR}" ]; then export XDG_RUNTIME_DIR=/run/user/"$(id -u)" if [ ! -d "${XDG_RUNTIME_DIR}" ]; then - mkdir "${XDG_RUNTIME_DIR}" + mkdir -p "${XDG_RUNTIME_DIR}" chmod 0700 "${XDG_RUNTIME_DIR}" fi fi +# set xdg cache dir if it's not defined +if [ -z "${XDG_CACHE_DIR}" ]; then + export XDG_CACHE_DIR=/tmp/"$(id -un)"/.cache + if [ ! -d "${XDG_CACHE_DIR}" ]; then + mkdir -p "${XDG_CACHE_DIR}" + chmod 0700 "${XDG_CACHE_DIR}" + fi +fi if [ -d "${HOME}/bin" ]; then pathprepend "${HOME}/bin" |