Skip to content

fix: link systemd user units so the settings portal activates - #3

Open
p134c0d3 wants to merge 1 commit into
singularityos-lab:mainfrom
p134c0d3:fix/portal-settings-backend-discoverable
Open

fix: link systemd user units so the settings portal activates#3
p134c0d3 wants to merge 1 commit into
singularityos-lab:mainfrom
p134c0d3:fix/portal-settings-backend-discoverable

Conversation

@p134c0d3

Copy link
Copy Markdown

Problem

libadwaita apps render in light mode even when the desktop is set to dark. The Settings portal backend (xdg-desktop-portal-singularity) reports the correct color-scheme, but it never runs: its systemd user unit installs to $prefix/lib/systemd/user, and systemd --user only scans /etc/systemd/user and /usr/lib/systemd/user. For non-standard prefixes (e.g. /opt/local) the unit is invisible, so D-Bus activation fails with ServiceUnknown: not activatable. Sandboxed (Flatpak) libadwaita apps read color-scheme only through the portal, so with no value served they fall back to light.

Fix

Link the shipped user units from $LIB/systemd/user at session startup and daemon-reload, so systemd can find and activate them regardless of install prefix. Preserves the existing systemd-managed lifecycle (the D-Bus SystemdService= activation path). On standard-prefix installs the units are already on systemd's search path, so the link is a harmless no-op (guarded with || true).

Testing

On an /opt/local install with the desktop set to dark:

  • Before: gdbus call ... org.freedesktop.appearance color-scheme → NotFound; Flatseal (Flatpak/libadwaita) opens light.
  • After: the unit links and activates; the portal returns color-scheme = 1; Flatseal opens dark and follows live dark/light toggles.

The portal backend's systemd user unit installs under
$prefix/lib/systemd/user, a path systemd --user does not scan for
non-standard prefixes (e.g. /opt/local). D-Bus activation of the
Settings portal backend then fails, so libadwaita apps never receive
the color-scheme/accent and fall back to light regardless of the
desktop dark-mode preference.

Link the shipped user units from the session at startup so systemd can
find and activate them whatever the install prefix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant