commit 79da656d0ccdb171fe5745de82ed53f4dd5c91d3
Author: jens <jens.se@icloud.com>
AuthorDate: Sun Dec 6 11:46:52 2026 +0100
Commit: jens <jens.se@icloud.com>
CommitDate: Sun Dec 6 11:46:52 2026 +0100
install: make PipeWire step robust without a user session bus
Enable the units with systemctl --global (no D-Bus needed) and only try
to start them in the current session if it is reachable, with a timeout,
so the install no longer stops at the PipeWire step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
install.sh | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/install.sh b/install.sh
index 55e5d9c..f6b9807 100755
--- a/install.sh
+++ b/install.sh
@@ -752,7 +752,21 @@ step_autostart() {
}
step_pipewire() {
- systemctl --user enable --now pipewire pipewire-pulse wireplumber
+ local units="pipewire.socket pipewire-pulse.socket pipewire.service pipewire-pulse.service wireplumber.service"
+ # Aktivera globalt för alla användare: kräver ingen användar-D-Bus, så det
+ # fungerar även via su/sudo/ssh eller innan user@UID-managern är igång.
+ sudo -n systemctl --global enable $units
+
+ # Försök starta direkt i den aktuella sessionen, men låt det aldrig stoppa
+ # installationen -- det räcker att tjänsterna startar vid nästa inloggning.
+ export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
+ if [ -S "$XDG_RUNTIME_DIR/systemd/private" ] || [ -S "$XDG_RUNTIME_DIR/bus" ]; then
+ timeout 20 systemctl --user daemon-reload || true
+ timeout 20 systemctl --user start pipewire pipewire-pulse wireplumber \
+ || echo "Kunde inte starta PipeWire nu -- startar vid nästa inloggning."
+ else
+ echo "Ingen användarsession för systemd hittades -- PipeWire startar vid nästa inloggning."
+ fi
}
# Låtsassteg för --demo: skriver lite "loggutdata" och väntar i proportion