From 505c4a4a13dce4e91e965c4a69b8e478e88cd36f Mon Sep 17 00:00:00 2001 From: cronidea <86153674+cronidea@users.noreply.github.com> Date: Tue, 28 Sep 2021 16:42:59 +0100 Subject: [PATCH] Add muteinputs Allows for all inputs to be muted using pamixer --- .local/bin/muteinputs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .local/bin/muteinputs diff --git a/.local/bin/muteinputs b/.local/bin/muteinputs new file mode 100644 index 00000000..9b6363fb --- /dev/null +++ b/.local/bin/muteinputs @@ -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