2023-01-24 15:33:08 +01:00
|
|
|
#! /bin/sh
|
2023-03-10 13:27:44 +01:00
|
|
|
if [ -d /usr/lib/systemd/user-environment-generators ];
|
2023-01-24 15:33:08 +01:00
|
|
|
then
|
|
|
|
run-parts /usr/lib/systemd/user-environment-generators
|
2023-03-10 13:27:44 +01:00
|
|
|
elif [ -d /usr/lib/systemd/system-environment-generators ];
|
|
|
|
then
|
|
|
|
run-parts /usr/lib/systemd/system-environment-generators
|
2023-01-24 15:33:08 +01:00
|
|
|
else
|
|
|
|
cat "$HOME"/.config/environment.d/*
|
|
|
|
fi | grep -v '#' | grep -v '^[[:space:]]*$' | while read -r cur_env; do export "${cur_env?}"; done
|
|
|
|
|
|
|
|
command -v ip >/dev/null 2>&1 &&
|
|
|
|
{
|
|
|
|
LOCAL_IP="$(ip route | sed -En '/.*linkdown/! s/.*src\s+([^ ]+)\s*/\1/p')"
|
|
|
|
|
|
|
|
export LOCAL_IP
|
|
|
|
TARGET_FILE="$(readlink -f "${XDG_RUNTIME_DIR:-${TMPDIR:-$HOME}}")/local_ip"
|
|
|
|
[ ! -r "$TARGET_FILE" ] && echo "$LOCAL_IP" > "$TARGET_FILE"
|
|
|
|
}
|
|
|
|
|
2023-04-05 19:13:27 +02:00
|
|
|
export UID
|
|
|
|
export GID
|
|
|
|
|
2023-01-24 15:33:08 +01:00
|
|
|
# Make sure we include this part only once
|
|
|
|
[ -n "$USER_ENVIRONMENT_GENERATORS" ] && return
|
|
|
|
export USER_ENVIRONMENT_GENERATORS=1
|
|
|
|
PATH="$HOME/.local/bin:$PATH"
|