#!/bin/bash#Script to move every input source to another sink using pactl command line and dmenu# pick an audio output from the listlist_sinks(){DEFAULT="$(pactlinfo|grep'Default Sink:'|cut-d' '-f3)"# pactl list sinks short | cut -d ' ' -f2 | grep -v "$DEFAULT" | head --lines 1pactllistsinksshort|grep-v'Generic_[^1]'|grep-v"$DEFAULT"|cut-d' '-f2|dmenu-i
}# move every audio source and change the default sinkchange_audio_sink(){sink_inputs=$(pactllistsink-inputs|grep'Sink Input'|cut-d'#'-f2)# if [[ -z "$sink_inputs" ]]# then# notify-send -t 1000 -h string:x-canonical-private-synchronous:volume-notification "Sink unchanged."# exit# fipactlset-default-sink"$1"whileread-rinput;do# move existing stream to inactive sinkpactlmove-sink-input"$input""$1"done<<<"$sink_inputs"notify-send-t1000-hstring:x-canonical-private-synchronous:volume-notification"Current sink: $1"}choice=$(list_sinks)change_audio_sink"$choice"