dotfiles/.scripts/toggleAudio

16 lines
339 B
Bash
Executable File

#!/usr/bin/env bash
dp="alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2"
headphone="alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
current="$(pactl get-default-sink)"
if [ "$current" = $headphone ]; then
pactl set-default-sink $dp
else
pactl set-default-sink $headphone
fi
pkill xmobar && xmobar&