[X2Go-Commits] [live-build-x2go] 05/95: added code to support selection of audio output
git-admin at x2go.org
git-admin at x2go.org
Wed Mar 20 22:45:48 CET 2019
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/openbox-magic-pixel-workaround
in repository live-build-x2go.
commit 19e85e4f491d4894f673997a5a0d9a58043f22fa
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Sun Feb 4 01:32:37 2018 +0100
added code to support selection of audio output
---
.../lib/live/config/2900-x2go-thinclientconfig | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
index 9711f09..bd44c5f 100755
--- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
+++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig
@@ -37,6 +37,35 @@ cat >/home/user/.xsession <<XSESSION
# Spawn PulseAudio
pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 'module-udev-detect' --exit-idle-time=65535 &
+AUDIOOUT=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+ awk -F'=' ' /^audioout=/ { print \$2 }' | \
+ tr -dc 'a-zA-Z0-9.:_\-@|')
+
+if [ -n "\$AUDIOOUT" ] ; then
+ if [ "\$AUDIOOUT" = "list" ] ; then
+ echo -en "\n\$(date +'%F | %T | ')'\$0': Available audio outputs:" | tee -a /dev/tty8
+ AUDIOOUTPUTS=\$( for CARD in \$(pacmd list-cards | grep -A1 index | awk -F '[<> \t]' ' \$2 == "name:" { print \$4 }'); do
+ pacmd list-cards | \
+ more +/"\$CARD" | \
+ grep -m 1 "\$CARD" -A100000 | \
+ more +/"profiles:" | \
+ grep -m 1 -B10000 "active profile:" | \
+ grep -A10000 "profiles" | \
+ grep "\W\Woutput:" | \
+ grep -v "active profile:" | \
+ awk -F'[+:]' '{gsub("\t","",$1) ; print "\"'\$CARD'|" \$1 ":" \$2 "\""} ';
+ done | \
+ sort -u )
+ for AUDIOOUTPUT in \$AUDIOOUTPUTS; do
+ echo -en "\n\$(date +'%F | %T | ')'\$0': \$AUDIOOUTPUT" | tee -a /dev/tty8
+ done
+ elif (echo "\$AUDIOOUT" | grep -q '^[^|]*|[^|]*\$') ; then
+ $(echo "\$AUDIOOUT" | sed -e 's/^/pacmd set-card-profile "/' -e 's/\$/"/' -e 's/|/" "/')
+ else
+ : # NOP
+ fi
+fi
+
# additional variable instead of "case \$(...) in", as we need the value again later on
XRANDRCMDTAINTED=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F '=' '\$1 == "xinerama" { print \$2 }')
--
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