[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] start-pulseaudio-x11: fix KDE version check

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Thu Oct 31 13:57:56 UTC 2019



Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio


Commits:
470c210c by Rickie Schroeder at 2019-10-31T13:42:41Z
start-pulseaudio-x11: fix KDE version check

Current check wasn't working in case when $DESKTOP_SESSION wasn't set
which happens when session is started without display manager like sddm.
Parsing "plasmashell -v" output should be more reliable and less hacky.

This also changes legacy backticks `...` to modern $(...) as recommended
by shellcheck:
https://github.com/koalaman/shellcheck/wiki/SC2006

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/751

- - - - -


1 changed file:

- src/daemon/start-pulseaudio-x11.in


Changes:

=====================================
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



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/470c210cdc865be52cc2bd42cdb14d5d162f6d50

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/470c210cdc865be52cc2bd42cdb14d5d162f6d50
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20191031/f2fe2f4a/attachment.html>


More information about the pulseaudio-commits mailing list