diff options
| author | Robert Günzler <r@gnzler.io> | 2021-04-26 13:15:44 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-04-26 13:15:44 +0200 |
| commit | 13a273e9689bba1e351c292bfb899577247088de (patch) | |
| tree | 59518c89d2c3bb92eef8d86cef06e2c23097b7f1 | |
| parent | 880339277b622b42bf4249e35244e9fe1c9c148f (diff) | |
profile: fix creation of xdg dirs
| -rw-r--r-- | .profile | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/.profile b/.profile index 99b456e..879b1e3 100644 --- a/.profile +++ b/.profile @@ -2,18 +2,26 @@ # set xdg runtime dir if it's not defined if [ -z "${XDG_RUNTIME_DIR}" ]; then export XDG_RUNTIME_DIR=/run/user/"$(id -u)" - if [ ! -d "${XDG_RUNTIME_DIR}" ]; then - mkdir -p "${XDG_RUNTIME_DIR}" - chmod 0700 "${XDG_RUNTIME_DIR}" - fi +fi +if [ ! -d "${XDG_RUNTIME_DIR}" ]; then + mkdir -p "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" 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 "${XDG_CACHE_DIR}" ]; then + mkdir -p "${XDG_CACHE_DIR}" + chmod 0700 "${XDG_CACHE_DIR}" +fi +# set xdg config home if it's not defined +if [ -z "${XDG_CONFIG_HOME}" ]; then + export XDG_CONFIG_HOME="${HOME}/.config" +fi +if [ ! -d "${XDG_CONFIG_HOME}" ]; then + mkdir -p "${XDG_CONFIG_HOME}" + chmod 0755 "${XDG_CONFIG_HOME}" fi if [ -d "${HOME}/bin" ]; then |