Add muteinputs

Allows for all inputs to be muted using pamixer
This commit is contained in:
cronidea 2021-09-28 16:42:59 +01:00 committed by GitHub
parent 162ed8889b
commit 505c4a4a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

17
.local/bin/muteinputs Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# only select sources that are an actual microphone
sources="$(pamixer --list-sources | awk '!/Built/{ if (NR!=1) {print $1} }')"
# check if the first source that is not a monitor is muted
muted="$(pamixer --source "$(echo "$sources" | head -1)" --get-mute)"
if [ "$muted" = "false" ]; then
for i in $sources; do
pamixer --source "$i" -m
done
else
for i in $sources; do
pamixer --source "$i" -u
done
fi