[Linux] Support muting and unmuting exactly one source
This commit is contained in:
parent
0cbb943629
commit
ba1dea3668
@ -1,5 +1,9 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
otherinputs () {
|
||||||
|
get_sink_input_info.hs | jq 'select(.application_process_id != "'"$1"'")'
|
||||||
|
}
|
||||||
|
|
||||||
thePID="$(xprop _NET_WM_PID -id $(xdotool getactivewindow) | grep -Eo '[0-9]*')"
|
thePID="$(xprop _NET_WM_PID -id $(xdotool getactivewindow) | grep -Eo '[0-9]*')"
|
||||||
sinkInfo="$(pashowinputbypid $thePID)"
|
sinkInfo="$(pashowinputbypid $thePID)"
|
||||||
sinkID="$(echo $sinkInfo | jq -r .sink_input_id)"
|
sinkID="$(echo $sinkInfo | jq -r .sink_input_id)"
|
||||||
@ -12,4 +16,9 @@ fi
|
|||||||
|
|
||||||
echo "$sinkID"
|
echo "$sinkID"
|
||||||
|
|
||||||
|
if [[ $1 == *"only"* ]]; then
|
||||||
|
pactl set-sink-input-mute "$sinkID" 0
|
||||||
|
otherinputs "$thePID" | jq -r .sink_input_id | xargs -I theid sh -c 'pactl set-sink-input-mute theid 1'
|
||||||
|
else
|
||||||
pactl set-sink-input-mute "$sinkID" "$newState"
|
pactl set-sink-input-mute "$sinkID" "$newState"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user