dotfiles/bin/autosink

12 lines
241 B
Plaintext
Raw Permalink Normal View History

2022-09-08 16:17:06 +00:00
#!/bin/sh
PREFERRED="bluez hdmi analog"
for KEYWORD in bluez hdmi analog; do
SINK=$(pactl list short sinks | awk '$2~"'$KEYWORD'"{print $2}')
if [ -n "$SINK" ]; then
pactl set-default-sink "$SINK"
break
fi
done