From 886631e2871237b2f207e938d01d24e137151780 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sat, 28 May 2022 17:44:37 +0200 Subject: [PATCH] [bash] Define XDG base directories. XDG base directory standard [1] defines environment variables with important paths in user home directory. For example, XDG_CONFIG_HOME points to a directory with configuration files. Many programs respect the XDG base directory specification. For example, git looks for it dotfile as either $HOME/.gitconfig or $XDG_CONFIG_HOME/git/config. Therefore, XDG environment variables should be defined early during startup. This commit adds 10-xdg.sh which defines XDG base directory variables. Prefix '10-' ensures that the files will be sourced by ~/.profile before other files in ~/.config/profile.d. [1] https://specifications.freedesktop.org/basedir-spec --- bash/.config/profile.d/10-xdg.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bash/.config/profile.d/10-xdg.sh diff --git a/bash/.config/profile.d/10-xdg.sh b/bash/.config/profile.d/10-xdg.sh new file mode 100644 index 0000000..ba87c5d --- /dev/null +++ b/bash/.config/profile.d/10-xdg.sh @@ -0,0 +1,13 @@ +# Copyright (c) 2022 Jakub Czajka +# License: GPL-3.0 or later. +# +# 10-xdg.sh - XDG Base Directory environment variables. + +export XDG_CONFIG_DIRS="/etc/xdg:${XDG_CONFIG_DIRS}" +export XDG_CACHE_HOME="${HOME}/.cache" +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_DATA_DIRS="/usr/local/share/:/usr/share/:${XDG_DATA_DIRS}" +export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_DESKTOP_DIR="${HOME}" +export XDG_LOG_HOME="${HOME}/.local/var/log" +export XDG_STATE_HOME="${HOME}/.local/state" -- 2.39.5