diff options
Diffstat (limited to 'source/l/pipewire')
-rw-r--r-- | source/l/pipewire/pipewire-disable.sh | 54 | ||||
-rw-r--r-- | source/l/pipewire/pipewire-enable.sh | 48 | ||||
-rw-r--r-- | source/l/pipewire/pipewire-media-session.desktop.sample | 9 | ||||
-rw-r--r-- | source/l/pipewire/pipewire-pulse.desktop.sample | 8 | ||||
-rwxr-xr-x | source/l/pipewire/pipewire.SlackBuild | 25 | ||||
-rw-r--r-- | source/l/pipewire/pipewire.desktop.sample | 9 |
6 files changed, 151 insertions, 2 deletions
diff --git a/source/l/pipewire/pipewire-disable.sh b/source/l/pipewire/pipewire-disable.sh new file mode 100644 index 000000000..8761d2619 --- /dev/null +++ b/source/l/pipewire/pipewire-disable.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This script will attempt to disable pipewire as the default audio server, +# changing it back to pulseaudio. + +# Rename the XDG autostart files: +for file in /etc/xdg/autostart/pipewire-media-session.desktop /etc/xdg/autostart/pipewire-pulse.desktop /etc/xdg/autostart/pipewire.desktop ; do + if [ -r $file ]; then + mv ${file} ${file}.sample + fi +done + +# Enable pulseaudio.desktop: +if grep -q "^Hidden=true$" /etc/xdg/autostart/pulseaudio.desktop ; then + grep -v "^Hidden=true$" /etc/xdg/autostart/pulseaudio.desktop > /etc/xdg/autostart/pulseaudio.desktop.new + mv /etc/xdg/autostart/pulseaudio.desktop.new /etc/xdg/autostart/pulseaudio.desktop +fi + +# Edit /etc/pulse/client.conf to enable autospawn: +sed -i "s/autospawn = no/autospawn = yes/g" /etc/pulse/client.conf +sed -i "s/allow-autospawn-for-root = no/allow-autospawn-for-root = yes/g" /etc/pulse/client.conf + +echo "Pulseaudio enabled as system audio server." +if ps ax | grep -q pipewire ; then + echo + echo "You may need to stop running daemon/pipewire processes." + echo "The clean way is to run these commands as the user that owns the processes:" + echo "/usr/bin/daemon --pidfiles=~/.run --name=pipewire --stop" + echo "/usr/bin/daemon --pidfiles=~/.run --name=pipewire-media-session --stop" + echo "/usr/bin/daemon --pidfiles=~/.run --name=pipewire-pulse --stop" + echo + echo "The quick and dirty way if nothing else on the machine is using the daemon" + echo "utility is to issue this command:" + echo "killall daemon" +fi diff --git a/source/l/pipewire/pipewire-enable.sh b/source/l/pipewire/pipewire-enable.sh new file mode 100644 index 000000000..a6a21dd7c --- /dev/null +++ b/source/l/pipewire/pipewire-enable.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This script will attempt to enable pipewire as the default audio server. + +# Disable this, as it is almost certainly left over from when pipewire +# used to store its config file in this location: +if [ -f /etc/pipewire/pipewire.conf ]; then + for file in /etc/pipewire/*.conf ; do + mv ${file} ${file}.obsolete + done +fi + +# Rename the XDG autostart files: +for file in /etc/xdg/autostart/pipewire-media-session.desktop.sample /etc/xdg/autostart/pipewire-pulse.desktop.sample /etc/xdg/autostart/pipewire.desktop.sample ; do + if [ -r $file ]; then + mv $file /etc/xdg/autostart/$(basename $file .sample) + fi +done + +# Disable pulseaudio.desktop: +if ! grep -q "^Hidden=true$" /etc/xdg/autostart/pulseaudio.desktop ; then + echo "Hidden=true" >> /etc/xdg/autostart/pulseaudio.desktop +fi + +# Edit /etc/pulse/client.conf to disable autospawn: +sed -i "s/autospawn = yes/autospawn = no/g" /etc/pulse/client.conf +sed -i "s/allow-autospawn-for-root = yes/allow-autospawn-for-root = no/g" /etc/pulse/client.conf + +echo "PipeWire enabled as system multimedia server." diff --git a/source/l/pipewire/pipewire-media-session.desktop.sample b/source/l/pipewire/pipewire-media-session.desktop.sample new file mode 100644 index 000000000..f9eb47582 --- /dev/null +++ b/source/l/pipewire/pipewire-media-session.desktop.sample @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=PipeWire Media Session +Comment=Start the PipeWire Media Session +Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-media-session /usr/bin/pipewire-media-session +Terminal=false +Type=Application +X-GNOME-Autostart-Phase=Initialization +X-KDE-autostart-phase=1 diff --git a/source/l/pipewire/pipewire-pulse.desktop.sample b/source/l/pipewire/pipewire-pulse.desktop.sample new file mode 100644 index 000000000..ff34dcbc8 --- /dev/null +++ b/source/l/pipewire/pipewire-pulse.desktop.sample @@ -0,0 +1,8 @@ +[Desktop Entry] +Version=1.0 +Name=PipeWire Pulse +Comment=Start the PipeWire Pulse +Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-pulse /usr/bin/pipewire-pulse +Terminal=false +Type=Application +X-GNOME-Autostart-Phase=Initialization diff --git a/source/l/pipewire/pipewire.SlackBuild b/source/l/pipewire/pipewire.SlackBuild index 86a6da0a0..71e686028 100755 --- a/source/l/pipewire/pipewire.SlackBuild +++ b/source/l/pipewire/pipewire.SlackBuild @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 2020 Eric Hameleers, Eindhoven, NL -# Copyright 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2020, 2021, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=pipewire VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -113,6 +113,19 @@ cd .. # Create system config file override directory: mkdir -p $PKG/etc/pipewire +# Add sample configuation files: +mkdir -p $PKG/etc/xdg/autostart +cp -a $CWD/pipewire.desktop.sample $PKG/etc/xdg/autostart +cp -a $CWD/pipewire-media-session.desktop.sample $PKG/etc/xdg/autostart +cp -a $CWD/pipewire-pulse.desktop.sample $PKG/etc/xdg/autostart +chown root:root $PKG/etc/xdg/autostart/* +chmod 644 $PKG/etc/xdg/autostart/* +mkdir -p $PKG/usr/sbin +cp -a $CWD/pipewire-disable.sh $PKG/usr/sbin +cp -a $CWD/pipewire-enable.sh $PKG/usr/sbin +chown root:root $PKG/usr/sbin/pipewire-disable.sh $PKG/usr/sbin/pipewire-enable.sh +chmod 755 $PKG/usr/sbin/pipewire-disable.sh $PKG/usr/sbin/pipewire-enable.sh + # Strip binaries: find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null @@ -129,6 +142,14 @@ cp -a \ CODE_OF_CONDUCT* COPYING* INSTALL* LICENSE* NEWS* PROTOCOL* README* \ $PKG/usr/doc/${PKGNAM}-$VERSION +# If there's a NEWS file, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r NEWS ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat NEWS | head -n 1000 > $DOCSDIR/NEWS + touch -r NEWS $DOCSDIR/NEWS +fi + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/source/l/pipewire/pipewire.desktop.sample b/source/l/pipewire/pipewire.desktop.sample new file mode 100644 index 000000000..19a83e7a6 --- /dev/null +++ b/source/l/pipewire/pipewire.desktop.sample @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=PipeWire Media System +Comment=Start the PipeWire Media System +Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire /usr/bin/pipewire +Terminal=false +Type=Application +X-GNOME-Autostart-Phase=Initialization +X-KDE-autostart-phase=1 |