update $WAYLAND_DISPLAY and $DISPLAY post login

The $WAYLAND_DISPLAY and $DISPLAY are prone to change between `greetd`'s
initialization and the user's login. Therefore, update these environment
variables so systemd services and/or d-bus services use the correct
values post login.
This commit is contained in:
Pratham Patel 2025-05-22 13:40:15 +05:30 committed by Michael Murphy
parent c22dcdfe06
commit dd4fa3daea

View file

@ -40,7 +40,13 @@ export DCONF_PROFILE=cosmic
if command -v dbus-update-activation-environment >/dev/null; then
# set environment variables for new units started by user service manager
dbus-update-activation-environment --systemd XDG_SESSION_TYPE XDG_CURRENT_DESKTOP DCONF_PROFILE
dbus-update-activation-environment --systemd \
DCONF_PROFILE \
DISPLAY \
WAYLAND_DISPLAY \
XDG_CURRENT_DESKTOP \
XDG_SESSION_TYPE \
# EOF
fi
# Run cosmic-session
if [[ -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then