From 1d31191074a6c423299ae2d7123304de087def0f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 7 Jun 2020 03:06:20 +0300 Subject: [PATCH] pa-mic: Calc default source from the known default sink --- audio/pa-mic-off | 5 ++++- audio/pa-mic-on | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.5