diff options
author | davidpkj <davidpenkow1@gmail.com> | 2022-08-24 20:30:48 +0200 |
---|---|---|
committer | davidpkj <davidpenkow1@gmail.com> | 2022-08-24 20:30:48 +0200 |
commit | 4f7ccffecdfa36c5e531654b8eec44199935d497 (patch) | |
tree | 971f684f37ece45354ac12e790681a08498a1f7f /scripts/mute |
added box scripts
Diffstat (limited to 'scripts/mute')
-rwxr-xr-x | scripts/mute | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/mute b/scripts/mute new file mode 100755 index 0000000..1103c0e --- /dev/null +++ b/scripts/mute @@ -0,0 +1,31 @@ +#!/bin/bash + +SOURCE="alsa_input.usb-R__DE_Microphones_R__DE_NT-USB_Mini_610BAACA-00.mono-fallback" + +if [[ "$1" == "shortstatus" ]]; then + VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*%)" + + if [[ "$VOLUME" == "0%" ]]; then + echo "OFF" + else + echo "ON" + fi + + exit +fi + +if [[ "$1" == "status" ]]; then + NAME="$(pactl list sources | grep -o Description:.* | sed -n 's/Description: //g;2p')" + VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*%)" + + echo "$NAME ($VOLUME)" + + exit +fi + +if [[ "$(pactl get-source-volume $SOURCE | grep -o [0-9]*%)" == "0%" ]]; then + pactl set-source-volume "$SOURCE" 70% +else + pactl set-source-volume "$SOURCE" 0% +fi + |