[X2Go-Commits] [live-build-x2go] 107/108: added script to force pulseaudio volume

git-admin at x2go.org git-admin at x2go.org
Wed Mar 20 22:13:39 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.

commit bef83bbaaa5a1212ac758b00db6107baeb43820d
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date:   Tue Mar 19 12:38:33 2019 +0100

    added script to force pulseaudio volume
---
 .../X11/Xsession.d/60x11-force-pulseaudio-volume   | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/config/includes.chroot/etc/X11/Xsession.d/60x11-force-pulseaudio-volume b/config/includes.chroot/etc/X11/Xsession.d/60x11-force-pulseaudio-volume
new file mode 100644
index 0000000..17f74ee
--- /dev/null
+++ b/config/includes.chroot/etc/X11/Xsession.d/60x11-force-pulseaudio-volume
@@ -0,0 +1,25 @@
+# Force pulseaudio volume
+
+PAVOL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F '=' '/^pavol=/ { print $2 }' | tr -dc '0-9%:|')
+
+if [ -n "$PAVOL" ] ; then
+        (
+                while ! pacmd dump 2>&1| grep -q set-card-profile ; do
+                        echo -en "\n$(date +'%F | %T | ')'$0': Waiting for pulseaudio to start ..." | tee -a /dev/tty8
+                        sleep 1
+                done
+                for DEVVOLPAIR in $(echo -e "$PAVOL" | tr '|' '\n'); do
+			if echo -e "$DEVVOLPAIR" | grep -q ':' ; then
+				PADEV=$(echo -e "$DEVVOLPAIR" | awk -F ':' '{ print $1 ')
+				VOLUME=$(echo -e "$DEVVOLPAIR" | awk -F ':' '{ print $2 ')
+			else
+				PADEV="0"
+				VOLUME=$DEVVOLPAIR
+			fi
+			pactl set-sink-mute $PADEV 0
+			pactl set-sink-volume $PADEV $VOLUME
+                        echo -en "\n$(date +'%F | %T | ')'$0': Set volume level '$VOLUME' for audio sink '#$PADEV'" | tee -a /dev/tty8 
+                done
+        ) &
+fi
+

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git


More information about the x2go-commits mailing list