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.

67 lines
1.6 KiB
Bash

#ft=sh
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_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
export XDG_STATE_HOME=${XDG_STATE_HOME:="$HOME/.local/state"}
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
env_file () {
file="${1}"
if [ ! -f "${file}" ]; then
return
fi
eval "$(
grep -v '^\s*\#' "${file}" |
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
if [ "${BASH_VERSION}" != "" ] && [ "$(ps -p $$ -ocomm=)" != sh ]; then
# shellcheck disable=SC1090
if [ -f "${HOME}/.bashrc" ]; then
. "${HOME}/.bashrc"
fi
fi