Skip to content

Instantly share code, notes, and snippets.

@joker1007
Last active February 19, 2024 20:29
Show Gist options
  • Save joker1007/4eb9fc5d483eb617e563bf621a4d512e to your computer and use it in GitHub Desktop.
Save joker1007/4eb9fc5d483eb617e563bf621a4d512e to your computer and use it in GitHub Desktop.
pipewire audio selector
#!/bin/bash
id=$(pw-dump Node | jq -r 'map({id: .id, class: .info.props["media.class"], desc: .info.props["node.description"]} | select(.desc != null)) | sort_by(.class, .desc) | .[] | [.id, .class, .desc] | @tsv' | wofi -di | cut -f 1)
if [ -n "$id" ]; then
echo "Setting default to $id"
wpctl set-default $id
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment