From: Oleg Broytman Date: Sun, 7 Jun 2020 00:06:20 +0000 (+0300) Subject: pa-mic: Calc default source from the known default sink X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=1d31191074a6c423299ae2d7123304de087def0f;p=audio-cdr-video.git pa-mic: Calc default source from the known default sink --- diff --git a/audio/pa-mic-off b/audio/pa-mic-off index 4d4ac7e..19fb613 100755 --- a/audio/pa-mic-off +++ b/audio/pa-mic-off @@ -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 diff --git a/audio/pa-mic-on b/audio/pa-mic-on index f4e3f35..d626128 100755 --- a/audio/pa-mic-on +++ b/audio/pa-mic-on @@ -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