1
0
Fork 0
mirror of https://gitlab.postmarketos.org/postmarketOS/pmaports.git synced 2025-07-23 14:55:14 +03:00
pmaports/extra-repos/systemd/pipewire/pipewire-launcher.sh
Clayton Craft 9ce37b783e
systemd: fork pipewire to build w/ systemd support (MR 5142) (MR 5563)
Unfortunately there are some code paths that are required to support
socket activation, and they are only enabled at build time with
-Dsystemd=enabled. On the bright side, service/socket unit files are
included...

Also note that I disabled test on armv7 since they fail in our CI using
qemu on x86_64. They pass in Alpine on native armv7.
2025-01-10 13:02:32 +01:00

22 lines
740 B
Bash

#!/bin/sh
# We need to kill any existing pipewire instance to restore sound
pkill -u "${USER}" -fx /usr/bin/pipewire-pulse 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/pipewire-media-session 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/wireplumber 1>/dev/null 2>&1
pkill -u "${USER}" -fx /usr/bin/pipewire 1>/dev/null 2>&1
exec /usr/bin/pipewire &
# wait for pipewire to start before attempting to start related daemons
while [ "$(pgrep -f /usr/bin/pipewire)" = "" ]; do
sleep 1
done
if [ -x /usr/bin/wireplumber ]; then
exec /usr/bin/wireplumber &
elif [ -x /usr/bin/pipewire-media-session ]; then
exec /usr/bin/pipewire-media-session &
fi
[ -f "/usr/share/pipewire/pipewire-pulse.conf" ] && exec /usr/bin/pipewire-pulse &