Files
nixos/resources/scripts/waybar/amixer-toggle.sh
T
2025-07-25 10:24:08 +02:00

12 lines
291 B
Bash
Executable File

#!/bin/bash
# Check the current state of the speaker
state=$(amixer -D pulse sget Master | awk '/\[on\]/{print "unmute"; exit} /\[off\]/{print "mute"; exit}')
# Toggle the state of the speaker
#
if [ "$state" = "[on] "]; then
amixer
# amixer -D pulse sset Master "$state" > /dev/null