pipewire-launcher 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # PipeWire launcher script for XDG compliant desktops on OpenRC.
  3. #
  4. # systemd users are very _STRONGLY_ advised to use the much
  5. # more reliable and predictable user units instead.
  6. # WARNING: This script assumes being run inside XDG compliant session,
  7. # which means D-Bus session instance is expected to be correctly set up
  8. # prior to this script starting. If that is not true, things may break!
  9. # Best to reap any existing daemons and only then try to start a new set.
  10. pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1
  11. # The core daemon which by itself does probably nothing.
  12. /usr/bin/pipewire &
  13. # The so called pipewire-pulse daemon used for PulseAudio compatibility.
  14. # Commenting this out will stop the PA proxying daemon from starting,
  15. # however ALSA (with pipewire-alsa), JACK (with jack-sdk) and PW API using
  16. # clients will still have access to audio and may end up clashing with
  17. # non-PW apps over HW control (most notably, /usr/bin/pulseaudio daemon).
  18. /usr/bin/pipewire -c pipewire-pulse.conf &
  19. # Hack for bug #822498 (Gentoo's Bugzilla)
  20. sleep 1
  21. # Finally a session manager is required for PipeWire to do anything.
  22. for session_manager in wireplumber pipewire-media-session; do
  23. command -v "$session_manager" &>/dev/null && break
  24. done
  25. exec "$session_manager"