commit: b43a884e15bb3118b567449ef7364e447cb84585
parent: ee0e6a3e9a5d284926e9f6523991e5d1b5076eaa
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 23 Dec 2019 17:42:49 +0100
.profile: Create XDG_{RUNTIME_DIR,CACHE_HOME} if non-existent
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/.profile b/.profile
@@ -52,8 +52,15 @@ export XDG_TEMPLATES_DIR="$HOME/templates"
export XDG_VIDEOS_DIR="$HOME/Videos"
export XDG_MUSIC_DIR="$HOME/Music"
export XDG_RUNTIME_DIR="/tmp/$(id -u)-xdg_runtime_dir"
-mkdir -p "${XDG_RUNTIME_DIR}"
-chmod 0700 "${XDG_RUNTIME_DIR}"
+[ -d "${XDG_RUNTIME_DIR}" ] || (
+ mkdir -p "${XDG_RUNTIME_DIR}"
+ chmod 0700 "${XDG_RUNTIME_DIR}"
+)
+export XDG_CACHE_HOME="/tmp/$(id -u)-xdg_cache_home"
+[ -d "${XDG_CACHE_HOME}" ] || (
+ mkdir -p "${XDG_CACHE_HOME}"
+ chmod 0700 "${XDG_CACHE_HOME}"
+)
## XKB configuration (Wayland+xinit)
#export XKB_DEFAULT_RULES=""