Skip to content

Instantly share code, notes, and snippets.

View tbulligan's full-sized avatar

Tomaso Bulligan tbulligan

View GitHub Profile
@tbulligan
tbulligan / connect_bluetooth_headphones.sh
Last active August 29, 2024 12:47 — forked from egelev/connect_bluetooth_headphones.sh
Connect bluetooth headphones on Pop!_OS 22.04 and potentially other distros using PipeWire
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pactl list | grep bluez_card | grep Name | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pactl list | grep bluez_card -A2 | grep 'device.string' | awk '{print $3}' | head -n 1)
temp="${temp%\"}"
temp="${temp#\"}"