diff options
| author | Robert Günzler <r@gnzler.io> | 2020-05-25 17:32:58 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-05-25 17:32:58 +0200 |
| commit | 22982eaa6edb89a6a1a03a358894e7b50de05ea5 (patch) | |
| tree | 25dcf0ae6d5c750457856e639cc7a8525bca4b22 /.profile | |
| parent | 601d940d0d1b583aeddd7c02e1db361e9c9d1729 (diff) | |
.profile: ensure we have XDG_RUNTIME_DIR set
Diffstat (limited to '.profile')
| -rw-r--r-- | .profile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.profile b/.profile index e8e2fed..6f6e3eb 100644 --- a/.profile +++ b/.profile @@ -1,3 +1,13 @@ + +# 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 "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" + fi +fi + if [ -d "${HOME}/bin" ]; then pathprepend "${HOME}/bin" pathprepend "${HOME}/bin/$(uname -n)" |