dotfiles

Configuration for the software I use.
git clone https://git.sr.ht/~jbauer/dotfiles
Log | Files | Refs | README | LICENSE

commit c891c034340548aa11e1df78166deaf0b2d5d9b9
parent 6aa2277d0ffe7c247d258441d30854febe70d403
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 19 Jun 2020 22:23:23 -0400

Create script for muting mic

Diffstat:
Adocs/scripts/sh/mute-microphone.sh | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/docs/scripts/sh/mute-microphone.sh b/docs/scripts/sh/mute-microphone.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Thank you Arch Wiki: https://wiki.archlinux.org/index.php/Dunst#Dunstify + +# Arbitrary but unique message id +msgId="557843" + +# Set the volume based on args given +amixer sset Capture toggle + +# Query amixer for the current volume and whether or not the speaker is muted +online="$(amixer get Capture | tail -1 | awk '{print $6}' | sed 's/[^a-z]*//g')" + +if [ "$online" = "off" ]; then + # Show the sound muted notification + dunstify -a "muteMic" -u low -i audio-input-microphone-muted-symbolic \ + -r "$msgId" "Microphone muted" +else + # Show the volume notification + dunstify -a "muteMic" -u low -i audio-input-microphone-high-symbolic \ + -r "$msgId" "Microphone unmuted" +fi +exit 0