From 877889da606a8b322ae820d216d017a64c0044ac Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 4 Nov 2020 11:10:01 +0100 Subject: [PATCH] daemon: Add "stop" argument to start-pulseaudio-x11 script As contradicting as it sounds, seems better than changing the script name. This "stop" argument makes it unload all X11 related modules, as opposed to the default behavior. Part-of: --- src/daemon/start-pulseaudio-x11.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/daemon/start-pulseaudio-x11.in b/src/daemon/start-pulseaudio-x11.in index 0e84315c3..722a639c0 100755 --- a/src/daemon/start-pulseaudio-x11.in +++ b/src/daemon/start-pulseaudio-x11.in @@ -17,6 +17,25 @@ set -e +if [ -n "$1" ] ; then + case $1 in + stop) + @PACTL_BINARY@ unload-module module-x11-publish > /dev/null + @PACTL_BINARY@ unload-module module-x11-cork-request > /dev/null + @PACTL_BINARY@ unload-module module-device-manager > /dev/null + @PACTL_BINARY@ unload-module module-x11-xsmp > /dev/null + exit 0 + ;; + start) + # Let it continue further down + ;; + *) + echo "Unknown argument $1" + exit 1 + ;; + esac +fi + if [ x"$DISPLAY" != x ] ; then @PACTL_BINARY@ load-module module-x11-publish "display=$DISPLAY xauthority=$XAUTHORITY" > /dev/null