]> git.phdru.name Git - audio-cdr-video.git/commitdiff
pa-mic: Calc default source from the known default sink
authorOleg Broytman <phd@phdru.name>
Sun, 7 Jun 2020 00:06:20 +0000 (03:06 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 7 Jun 2020 00:06:20 +0000 (03:06 +0300)
audio/pa-mic-off
audio/pa-mic-on

index 4d4ac7e630efd8fae7474594adbb66c2d6f325d4..19fb613dc3028af42e1a0b09a870e8a2409d019c 100755 (executable)
@@ -1,4 +1,7 @@
 #! /bin/sh
 
-     pactl set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo 1 &&
+default_sink=`cat "$HOME"/.config/pulse/default`
+default_source=`echo $default_sink | sed s/output/input/`
+
+     pactl set-source-mute $default_source 1 &&
 exec pactl set-card-profile 0 output:analog-stereo
index f4e3f356013a93cf6a5b357ae15f9f91fc900657..d6261287c32462296f1aa9fc8397df33b038ab12 100755 (executable)
@@ -1,4 +1,7 @@
 #! /bin/sh
 
-     pactl set-card-profile 0 output:analog-stereo+input:analog-stereo &&
+default_sink=`cat "$HOME"/.config/pulse/default`
+default_source=`echo $default_sink | sed s/output/input/`
+
+     pactl set-card-profile 0 $default_source &&
 exec pactl set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo 0