about summary refs log tree commit diff
path: root/profile/.profile.d/10_xdg.sh
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>1970-01-01 03:00:00 +0300
committerAzat Bahawi <azat@bahawi.net>2022-09-20 11:51:54 +0300
commit38bab29776950ac2364ed64195b89887717c33de (patch)
treeedaaf366a55dbe96d268019124536bc504c64e87 /profile/.profile.d/10_xdg.sh
chore: init HEAD master
Diffstat (limited to 'profile/.profile.d/10_xdg.sh')
-rw-r--r--profile/.profile.d/10_xdg.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/profile/.profile.d/10_xdg.sh b/profile/.profile.d/10_xdg.sh
new file mode 100644
index 0000000..8a7cebe
--- /dev/null
+++ b/profile/.profile.d/10_xdg.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+_local="${HOME}/.local"
+
+export XDG_CACHE_HOME="${_local}/var/cache"
+export XDG_CONFIG_HOME="${_local}/etc"
+export XDG_DATA_HOME="${_local}/var/lib"
+export XDG_DESKTOP_DIR="${HOME}/tmp"
+export XDG_DOCUMENTS_DIR="${HOME}/doc"
+export XDG_DOWNLOAD_DIR="${HOME}/tmp"
+export XDG_MUSIC_DIR="${HOME}/music"
+export XDG_PICTURES_DIR="${HOME}/tmp"
+export XDG_PUBLICSHARE_DIR="${HOME}/tmp"
+export XDG_RUNTIME_DIR="${_local}/var/run"
+export XDG_TEMPLATES_DIR="${HOME}/tmp"
+export XDG_VIDEOS_DIR="${HOME}/tmp"
+
+unset _local
+
+_xdg_dirs="
+${XDG_CACHE_HOME}
+${XDG_CONFIG_HOME}
+${XDG_DATA_HOME}
+${XDG_DESKTOP_DIR}
+${XDG_DOCUMENTS_DIR}
+${XDG_DOWNLOAD_DIR}
+${XDG_MUSIC_DIR}
+${XDG_PICTURES_DIR}
+${XDG_PUBLICSHARE_DIR}
+${XDG_RUNTIME_DIR}
+${XDG_TEMPLATES_DIR}
+${XDG_VIDEOS_DIR}
+"
+
+for _xdg_dir in ${_xdg_dirs}; do
+	[ ! -d "${_xdg_dir}" ] && mkdir -p "${_xdg_dir}"
+done
+
+unset _xdg_dir _xdg_dirs

Consider giving Nix/NixOS a try! <3