dotfiles-remastered/.config/waybar/mute-toggle.sh

12 lines
265 B
Bash
Raw Permalink Normal View History

2023-05-05 13:35:28 +00:00
#!/usr/bin/env sh
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
if pactl get-source-mute @DEFAULT_SOURCE@ | grep yes; then
# Muted
mpv "$XDG_CONFIG_HOME/waybar/mute.wav" --volume=60
else
# Not muted
mpv "$XDG_CONFIG_HOME/waybar/unmute.wav" --volume=60
fi