etc/toggle_mute.sh

16 lines
317 B
Bash
Raw Normal View History

2021-02-19 09:26:35 +00:00
#!/bin/sh
if pacmd dump | grep -v monitor | grep -q '^set-source-mute .* no$'; then
mute=yes
else
mute=no
fi
pacmd dump | sed "/monitor/d;/^set-source-mute /!d;s/ \(no\|yes\)$/ $mute/" | pacmd
if [ "$mute" = "yes" ]; then
notify-send -u normal -t 1000 muted
else
notify-send -u critical -t 1000 UNMUTED
fi