dotfiles/hypr/scripts/toggle-mute.sh
2023-12-01 16:58:57 +08:00

12 lines
265 B
Bash
Executable File

#/bin/bash
ACTIVE=$(echo $(amixer get Master | grep -oP '(?<=\[)[^\[\]]*(?=\])') | awk '{print $2}')
if [ "$ACTIVE" == "on" ]; then
amixer set Master mute
notify-send -r 1 "Muted: Yes"
else
amixer set Master unmute
notify-send -r 1 "Muted: No"
fi