diff --git a/src/daemon/start-pulseaudio-x11.in b/src/daemon/start-pulseaudio-x11.in index 1b5f429c9..1f12cfbbf 100755 --- a/src/daemon/start-pulseaudio-x11.in +++ b/src/daemon/start-pulseaudio-x11.in @@ -22,9 +22,11 @@ if [ x"$DISPLAY" != x ] ; then @PACTL_BINARY@ load-module module-x11-publish "display=$DISPLAY" > /dev/null @PACTL_BINARY@ load-module module-x11-cork-request "display=$DISPLAY" > /dev/null + # KDE plasma versions older than 5.17.0 use module-device-manager's routing API. + # Check for current plasma version and load module if it's necessary. if [ x"$KDE_FULL_SESSION" = x"true" ]; then - plasmaversion=`grep "X-KDE-PluginInfo-Version" $DESKTOP_SESSION.desktop | cut -d "=" -f2 | cut -d "." -f1,2 | tr -d "."` - if [ "$plasmaversion" -lt "517" ]; then + plasmaversion="$(plasmashell -v 2>/dev/null | sed -n 's/^plasmashell \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1*1000000+\2*1000+\3/p' | head -1)" + if [ -n "$plasmaversion" ] && [ "$((plasmaversion))" -lt "5017000" ]; then @PACTL_BINARY@ load-module module-device-manager "do_routing=1" > /dev/null fi fi