Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
517 B · 18 lines
Shell
at master
12345678910111213141516171819#!/bin/bash## Switches the current default audio sink to the next available sink using pactl.
# Get all sinks via pactlsinks=$(pactl list short sources | cut -f 2)
# Get current default sinkcurrent_sink=$(pactl info | grep "Default Source" | cut -d ' ' -f 3)
# Get sink after current sinknext_sink=$(echo "$sinks" | grep -A1 "$current_sink" | tail -n1)if [ "$next_sink" == "$current_sink" ]; then next_sink=$(echo "$sinks" | head -n1)fi
# Set next sink as defaultpactl set-default-source "$next_sink"