feat: add support for xdg directories
This commit is contained in:
parent
a3f9c9f462
commit
f6002e0668
1 changed files with 28 additions and 0 deletions
28
source/xdg.zsh
Normal file
28
source/xdg.zsh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# xdg base directory variables
|
||||
#
|
||||
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
|
||||
if [ -z "${XDG_CONFIG_HOME}" ]; then
|
||||
export XDG_CONFIG_HOME="${HOME}/.config"
|
||||
fi
|
||||
|
||||
if [ -z "${XDG_CACHE_HOME}" ]; then
|
||||
export XDG_CACHE_HOME="${HOME}/.cache"
|
||||
fi
|
||||
|
||||
if [ -z "${XDG_DATA_HOME}" ]; then
|
||||
export XDG_DATA_HOME="${HOME}/.local/share"
|
||||
fi
|
||||
|
||||
if [ -z "${XDG_STATE_HOME}" ]; then
|
||||
export XDG_STATE_HOME="${HOME}/.local/state"
|
||||
fi
|
||||
|
||||
# XDG_RUNTIME_DIR is set when using pam_systemd
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
export XDG_RUNTIME_DIR=/tmp
|
||||
fi
|
||||
|
||||
# vim: ft=zsh expandtab tabstop=2 shiftwidth=2
|
Loading…
Reference in a new issue