about summary refs log tree commit diff
path: root/profile/.profile.d/10_xdg.sh
blob: 8a7cebe65d45455cf4d5efdfb45b6009f187e2b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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