diff options
-rw-r--r-- | sh/.profile | 16 | ||||
-rw-r--r-- | xdg/.config/environment.d/10-xdg_base_dir.conf | 6 | ||||
-rw-r--r-- | xdg/.config/profile.d/10-xdg.sh | 3 |
3 files changed, 14 insertions, 11 deletions
diff --git a/sh/.profile b/sh/.profile index 3b7e561..7095e1a 100644 --- a/sh/.profile +++ b/sh/.profile @@ -1,7 +1,7 @@ #!/bin/sh # shellcheck disable=2046 -# use systemd-environment-d-generator(8) to generate environment, and export those variables +# Use systemd-environment-d-generator(8) to generate environment, and export those variables # # See: https://wiki.archlinux.org/title/Environment_variables#Per_Wayland_session for gen in /usr/lib/systemd/user-environment-generators/*; do @@ -10,20 +10,14 @@ for gen in /usr/lib/systemd/user-environment-generators/*; do fi done -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u "$USER")}" -export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" -export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" - +# Manually parse and export XDG user directories. xdg-user-dirs-update is disabled in +# $XDG_CONFIG_HOME/user-dirs.conf due to how it handles non-existant directories +# +# See: https://wiki.archlinux.org/title/XDG_user_directories if [ -e "$HOME/.config/user-dirs.dirs" ]; then export $(xargs <"$HOME/.config/user-dirs.dirs") fi -export PATH="$PATH:$HOME/.local/bin" - # Adopt the behavior of the system wide configuration for application specific settings # # See: https://wiki.archlinux.org/title/Command-line_shell#/etc/profile diff --git a/xdg/.config/environment.d/10-xdg_base_dir.conf b/xdg/.config/environment.d/10-xdg_base_dir.conf new file mode 100644 index 0000000..a687b55 --- /dev/null +++ b/xdg/.config/environment.d/10-xdg_base_dir.conf @@ -0,0 +1,6 @@ +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} +XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} +XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} +XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} +XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} +XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-${XDG_CONFIG_DIRS:-/etc/xdg}} diff --git a/xdg/.config/profile.d/10-xdg.sh b/xdg/.config/profile.d/10-xdg.sh new file mode 100644 index 0000000..3edf889 --- /dev/null +++ b/xdg/.config/profile.d/10-xdg.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +export PATH="$PATH:$HOME/.local/bin" |