nixos/config/home/scripts/audio/get-sink-name.sh

13 lines
274 B
Bash
Raw Normal View History

2024-07-07 21:19:08 +01:00
#!/usr/bin/env bash
SINK=$(pactl get-default-sink)
if [ $SINK = "alsa_output.pci-0000_1f_00.3.analog-stereo" ]; then
echo "Speakers"
elif [ $SINK = "alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" ]; then
echo "Headphones"
else
echo "-"
fi