From bcd4636a8f1235ef9429599e04d294384572650e Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Wed, 6 Mar 2024 12:46:39 +0100 Subject: ssf fix; cycle_pa_sinks --- cycle_pa_sinks | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 cycle_pa_sinks (limited to 'cycle_pa_sinks') diff --git a/cycle_pa_sinks b/cycle_pa_sinks new file mode 100755 index 0000000..a45ba15 --- /dev/null +++ b/cycle_pa_sinks @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Cycle between the current PulseAudio sinks. +# Based on https://askubuntu.com/a/740002 +# +# Usage: ./cycle_pa_sinks +################################################################################ + +new_sink=$(pacmd list-sinks | grep -E "index|device.product.name" | tee /dev/stdout | grep -m1 -A3 "* index" | tail -2) +new_sink_idx=$(echo "$new_sink" | head -n1 | cut -c12-) +new_sink_name=$(echo "$new_sink" | tail -n1 | cut -f2 -d'"') + +echo "Setting default sink to: #$new_sink_idx ($new_sink_name)"; +pacmd set-default-sink $new_sink_idx -- cgit v1.2.3