aports/community/phosh/dbus-launch-phosh-session.patch

41 lines
1.6 KiB
Diff

Patch-Source: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/93575
---
From 649efc9f21438e0fe43028fe311a395515348a19 Mon Sep 17 00:00:00 2001
From: Achill Gilgenast <achill@achill.org>
Date: Sun, 23 Nov 2025 13:18:29 +0100
Subject: [PATCH] phosh-session: Launch dbus session if none is already running
In OpenRC we have to manually run the dbus session since (unlike
systemd) OpenRC isn't already providing one.
By checking $DBUS_SESSION_BUS_ADDRESS, we can safely assume it is not
already running (either by systemd or manually added in OpenRC setups).
Downstream-Issue: https://gitlab.alpinelinux.org/alpine/aports/-/issues/17737
Signed-off-by: Achill Gilgenast <achill@achill.org>
---
data/phosh-session.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/data/phosh-session.in b/data/phosh-session.in
index 878e716d9d09..0f0bb9bf45b4 100755
--- a/data/phosh-session.in
+++ b/data/phosh-session.in
@@ -50,8 +50,12 @@ if which systemd-cat >/dev/null 2>&1; then
SYSTEMD_CAT="systemd-cat -t phoc"
fi
+if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
+ DBUS_RUN_SESSION="dbus-run-session"
+fi
+
[ -n "$WLR_BACKENDS" ] || WLR_BACKENDS=drm,libinput
export WLR_BACKENDS
# Run gnome-session through a login shell so it picks
# variables from /etc/profile.d (XDG_*)
-exec $SYSTEMD_CAT "${COMPOSITOR}" -v -S -C "${PHOC_INI}" -E "bash -lc 'exec ${GNOME_SESSION} --disable-acceleration-check --session=phosh'"
+exec $SYSTEMD_CAT $DBUS_RUN_SESSION "${COMPOSITOR}" -v -S -C "${PHOC_INI}" -E "bash -lc 'exec ${GNOME_SESSION} --disable-acceleration-check --session=phosh'"
--
2.52.0