From 68accb1a45a1fdaaba65106fc1f5fd37907bc68a Mon Sep 17 00:00:00 2001 From: p134c0d3 <70922864+p134c0d3@users.noreply.github.com> Date: Sun, 19 Jul 2026 16:18:56 -0500 Subject: [PATCH] fix: link systemd user units so the settings portal activates 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. --- src/singularity-desktop-session | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/singularity-desktop-session b/src/singularity-desktop-session index 9de5c22..e7607b7 100755 --- a/src/singularity-desktop-session +++ b/src/singularity-desktop-session @@ -50,6 +50,15 @@ pkill -TERM -x singularity-desktop 2>/dev/null || true pkill -x singularity-polkit-agent 2>/dev/null || true sleep 0.3 nohup "$BIN/singularity-polkit-agent" >> "$_STATE/polkit.log" 2>&1 & +# Our systemd user units ship under $LIB/systemd/user, a path systemd --user +# does not scan for non-standard prefixes (e.g. /opt/local). Without linking +# them, D-Bus activation of the Settings portal backend fails and libadwaita +# apps never receive the color-scheme/accent, falling back to light. +for _unit in "$LIB"/systemd/user/*.service; do + [ -e "$_unit" ] || continue + systemctl --user link "$_unit" 2>/dev/null || true +done +systemctl --user daemon-reload 2>/dev/null || true # Restart the portal so it picks up the live session environment, but do NOT # block on it: xdg-desktop-portal can hang ~25s on its settings-proxy timeout # waiting for our portal backend, which would delay the shell launch below.