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.
environment variables
The goal is to update the environment variables for the user's systemd
session **and** the services listening on user's d-bus session.
Until now, the variables were updated using the `import-environment`
environment command of `systemctl`. But, it would only be executed if
systemd was present on the host system. Leaving the variables on the
d-bus side either uninitialized or with incorrect values.
Therefore, instead of using `systemctl`, use the
`dbus-update-activation-environment` command to initialize/update the
environment variables for user's d-bus session but also for user's
systemd session. This is done by passing the `--systemd` option.
When systemd is not detected, the command doesn't fail, it simply
doesn't update the variables for user's systemd session. And since a
systemd user session doesn't exist, no harm no foul.
Setting XCURSOR_THEME messes up custom cursor theme overrides, so let's set the Cosmic cursor theme another way in distros and such
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
This causes the cosmic-session to have a separate
writable dconf-database (while still inheriting
the default user database).
This will (partially) prevent issues such as
https://github.com/pop-os/cosmic-epoch/issues/1174
in the future, as other desktops won't pick up
cosmic's dconf profile.
This makes sure together with our XSettings implementation in cosmic-comp,
that QT apps running on their xcb backend will react to the DPI values
we are setting by changing their internal scaling.