Skip to content

Instantly share code, notes, and snippets.

@un-def
un-def / switch-sink.bash
Created January 27, 2022 21:15
Switch PulseAudio sinks
#!/usr/bin/env bash
die() {
notify-send "${NOTIFICATION_SUMMARY}" "${1}" -i audio-volume-muted -t 3000
exit 1
}
config_path="${XDG_CONFIG_HOME:-$HOME/.config}/switch-sink.conf.bash"
[[ -f ${config_path} ]] || die 'Config not found'
# shellcheck disable=SC1090