You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB
Bash

export LANGUAGE=en_US:en
export LC_MESSAGES=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_COLLATE=en_US.UTF-8
export XDG_BIN_HOME="${XDG_BIN_HOME:=$HOME/.local/bin}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:=$HOME/.cache}"
export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:=/etc/xdg}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}"
export XDG_DATA_DIRS="${XDG_DATA_DIRS:=/usr/local/share:/usr/share}"
export XDG_DATA_HOME="${XDG_DATA_HOME:=$HOME/.local/share}"
export XDG_INCLUDE_HOME="${XDG_INCLUDE_HOME:=$HOME/.local/include}"
export XDG_STATE_HOME="${XDG_STATE_HOME:=$HOME/.local/state}"
{{- if eq .chezmoi.os "darwin" -}}
if [ "${XDG_RUNTIME_DIR}" = "" ]; then
__TMPDIR__=
__LINK__=/tmp/$(id -u)
if [ -L "${__LINK__}" ]; then
__TMPDIR__="$(readlink "${__LINK__}")"
else
__TMPDIR__="$(mktemp -d)"
ln -s "${__TMPDIR__}" "${__LINK__}"
fi
XDG_RUNTIME_DIR="${__TMPDIR__}"
unset __TMPDIR__ __LINK__
fi
export XDG_RUNTIME_DIR
{{- end }}
env_file () {
if [ ! -f "${1}" ]; then
return
fi
eval "$(
grep -v '^\s*\#' "${1}" |
grep -v '^\s*$' |
sed 's/^\s*export//g' |
sed 's/^/export /g'
)"
}
env_file "${XDG_CONFIG_HOME}/user-dirs.dirs"
if [ -d "${XDG_CONFIG_HOME}/profile/env.d" ]; then
for file in "${XDG_CONFIG_HOME}"/profile/env.d/*.env; do
env_file "${file}"
done
fi
unset env_file
if [ -d "${XDG_CONFIG_HOME}/profile/profile.d" ]; then
for file in "${XDG_CONFIG_HOME}"/profile/profile.d/*.sh; do
if [ -r "$file" ]; then
#shellcheck disable=1090
. "$file"
fi
done
fi
# vim: ft=sh