diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-05-05 11:30:40 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-05-05 11:30:40 +0100 |
commit | 3023707d355581e5dc6945aa9c8f4d59e508a8b5 (patch) | |
tree | 5bf569d557ba145002d922f72eadde17410572d4 /media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 | |
parent | 4e777c0133d093c9c8b992c92e0f244e2055bf71 (diff) |
gentoo auto-resync : 05:05:2023 - 11:30:40
Diffstat (limited to 'media-video/pipewire/files/gentoo-pipewire-launcher.in-r1')
-rw-r--r-- | media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 new file mode 100644 index 000000000000..345298c0b6ae --- /dev/null +++ b/media-video/pipewire/files/gentoo-pipewire-launcher.in-r1 @@ -0,0 +1,52 @@ +#!/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! + +restart () { + echo "Terminating PipeWire processes ..." + pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1 + pwait -u "${USER}" -x pipewire\|wireplumber + echo "PipeWire terminated." +} + +if [ "${#}" -gt 0 ] +then + if [ "${1}" = 'restart' ] + then + restart + else + echo "Unrecognised argument." + echo "Usage: gentoo-pipewire-launcher [restart]" + exit 1 + fi +fi + +if pgrep -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1 +then + echo "PipeWire already running, exiting." + echo "(Use 'gentoo-pipewire-launcher restart' to restart PipeWire and WirePlumber.)" + exit 1 +fi + +# The core daemon which by itself does probably nothing. +@GENTOO_PORTAGE_EPREFIX@/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). +@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire -c pipewire-pulse.conf & + +# Hack for bug #822498 +sleep 1 + +# Finally a session manager is required for PipeWire to do anything. +exec @GENTOO_PORTAGE_EPREFIX@/usr/bin/wireplumber |