dotfiles/.scripts/toggleAudio

16 lines
339 B
Plaintext
Raw Permalink Normal View History

2021-12-01 18:05:47 +01:00
#!/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
2021-12-19 14:57:13 +01:00
pkill xmobar && xmobar&