diff options
author | Steve McIntyre <steve@einval.com> | 2023-04-07 19:04:33 +0100 |
---|---|---|
committer | Steve McIntyre <steve@einval.com> | 2023-04-07 19:04:33 +0100 |
commit | 031f3454137fc5954c74c4c277ea2f8b0fe7c221 (patch) | |
tree | 5fa6c08ceef1ef6a4b80594c0df1b89b9930c2b1 | |
parent | bc5a9c67e963cf71762d4a1ecab42c36ece4c6a8 (diff) | |
download | steve-scripts-031f3454137fc5954c74c4c277ea2f8b0fe7c221.zip |
Add support for controlling the mic mute too
-rwxr-xr-x | audio_volume | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/audio_volume b/audio_volume index 4473fbd..81c256b 100755 --- a/audio_volume +++ b/audio_volume @@ -10,6 +10,9 @@ if [ "$INPUT"x = ""x ]; then fi SINK="$(pactl list short sinks | awk '/RUNNING/ {print $2}')" +SOURCE="$(pactl list sources | awk ' + /Name: / {name=$2} + /Description: Tiger Lake.*Headphone/ {print name}')" FULL_VOLUME=99999 # Call pactl and parse the output. There are two volume levels, for @@ -41,9 +44,15 @@ case "$INPUT" in echo "$0: got $INPUT, old audio level $OLD_LEVEL, setting audio level $NEW_LEVEL" ;; mute) - # Toggle mute on/off + # Toggle output mute on/off + echo "$0: got $INPUT, toggling output mute" pactl set-sink-mute "$SINK" toggle ;; + micmute) + # Toggle input mute on/off + echo "$0: got $INPUT, toggling mic mute" + pactl set-source-mute "$SOURCE" toggle + ;; state) # Just print the current level LEVEL=$(sink_volume) |