yursan9
Love it! I've wanted to bind a key to switching between outputs for some time now.
😃
EDIT:
In case anyone else is interested.
#!/bin/bash
#Toggle default audio output between two possible outputs
adefault=$(pacmd stat | grep "Default source name:" | awk '{print $4}')
if [ "$adefault" = "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" ]; then {
pacmd set-default-sink alsa_output.pci-0000_03_00.1.hdmi-stereo-extra1
} else {
pacmd set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
}
fi
You'll have to modify it for your outputs, but I just wrote this to toggle it. So I now have one keybind setup to run this script.
It gets the current audio output. Checks it's current value compared to one stored possible value and then decides based on its current status what it should do.