#!/bin/bash SOURCE="alsa_input.usb-R__DE_Microphones_R__DE_NT-USB_Mini_610BAACA-00.mono-fallback" SOURCE="$(pactl get-default-source)" VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*% | head -n 1)" if [[ "$1" == "shortstatus" ]]; then if [[ "$VOLUME" == "0%" ]]; then echo "Muted" else echo "" fi exit fi if [[ "$1" == "status" ]]; then NAME="$(pactl list sources | grep -o Description:.* | sed -n 's/Description: //g;2p')" echo "$NAME ($VOLUME)" exit fi if [[ "$VOLUME" == "0%" ]]; then pactl set-source-volume "$SOURCE" 70% notify-send -u low "Unmuted" -r 110 else pactl set-source-volume "$SOURCE" 0% notify-send -u low "Muted" -r 110 fi