Skip to content

Instantly share code, notes, and snippets.

@jkcdarunday
jkcdarunday / switch-audio.sh
Last active November 19, 2024 14:45
A shell script that switches to the next available Pulseaudio/Pipewire Pulse output device/sink
#!/bin/bash
# Author: Jan Keith Darunday <[email protected]>
# Description: A shell script that switches to the next available Pulseaudio output device/sink
# Note: This uses pactl instead of pacmd since pacmd is not available in pipewire
function get_current_sink() {
pactl info | sed -En 's/Default Sink: (.*)/\1/p'
}
SINKS=$(pactl list short sinks | grep -v easyeffects)