summaryrefslogtreecommitdiff
path: root/nonsystemd/pipewire/pipewire-launcher
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2022-05-14 21:25:57 -0400
committerDavid P <megver83@parabola.nu>2022-05-14 21:25:57 -0400
commitc3dd2bc711badabfbdd3042e3397dfafc515da1b (patch)
treed56b30096b3d1d6d23f6395426b683468ce10c92 /nonsystemd/pipewire/pipewire-launcher
parentcf8254528920035df1d85b25287d2b10edee7e7f (diff)
downloadabslibre-c3dd2bc711badabfbdd3042e3397dfafc515da1b.tar.gz
abslibre-c3dd2bc711badabfbdd3042e3397dfafc515da1b.tar.bz2
abslibre-c3dd2bc711badabfbdd3042e3397dfafc515da1b.zip
updpkg: nonsystemd/pipewire 1:0.3.51-1.nonsystemd1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'nonsystemd/pipewire/pipewire-launcher')
-rw-r--r--nonsystemd/pipewire/pipewire-launcher32
1 files changed, 32 insertions, 0 deletions
diff --git a/nonsystemd/pipewire/pipewire-launcher b/nonsystemd/pipewire/pipewire-launcher
new file mode 100644
index 000000000..d220684d0
--- /dev/null
+++ b/nonsystemd/pipewire/pipewire-launcher
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PipeWire launcher script for XDG compliant desktops on OpenRC.
+#
+# systemd users are very _STRONGLY_ advised to use the much
+# more reliable and predictable user units instead.
+
+# WARNING: This script assumes being run inside XDG compliant session,
+# which means D-Bus session instance is expected to be correctly set up
+# prior to this script starting. If that is not true, things may break!
+
+# Best to reap any existing daemons and only then try to start a new set.
+pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1
+
+# The core daemon which by itself does probably nothing.
+/usr/bin/pipewire &
+
+# The so called pipewire-pulse daemon used for PulseAudio compatibility.
+# Commenting this out will stop the PA proxying daemon from starting,
+# however ALSA (with pipewire-alsa), JACK (with jack-sdk) and PW API using
+# clients will still have access to audio and may end up clashing with
+# non-PW apps over HW control (most notably, /usr/bin/pulseaudio daemon).
+/usr/bin/pipewire -c pipewire-pulse.conf &
+
+# Hack for bug #822498 (Gentoo's Bugzilla)
+sleep 1
+
+# Finally a session manager is required for PipeWire to do anything.
+for session_manager in wireplumber pipewire-media-session; do
+ command -v "$session_manager" &>/dev/null && break
+done
+exec "$session_manager"