Skip to content

Instantly share code, notes, and snippets.

@ventos
Created January 18, 2021 20:25
Show Gist options
  • Save ventos/32511e348a4793879eda54580f15b8f3 to your computer and use it in GitHub Desktop.
Save ventos/32511e348a4793879eda54580f15b8f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
SINK_COUNT=$(pactl list short sinks | wc -l)
running=$(pactl list short sinks | grep "RUNNING")
running_ID=$(echo -n $running | awk '{print $1}')
new_ID=$(( ($running_ID + 1) % $SINK_COUNT))
pactl set-default-sink $new_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment