it’s somewhat vibe coded but the one i probably use the most is this one to swap between speakers and headset. the device name to look for is just put directly in there, it’d take some adjustment to run it on different machines. this is in my .bashrc:
# switch sinks
toggle_audio() {
# Find headset sink ID dynamically
headset_id=$(pactl list sinks short | grep "Plantronics" | awk '{print $1}')
# Find speakers sink ID dynamically
speakers_id=$(pactl list sinks short | grep "pci-0000_05_00.6" | awk '{print $1}')
# Get current default sink
current_sink=$(pactl get-default-sink)
# Get current sink ID
current_id=$(pactl list sinks short | grep "$current_sink" | awk '{print $1}')
# Toggle between the two
if [ "$current_id" = "$headset_id" ]; then
pactl set-default-sink "$speakers_id"
echo "Switched to speakers (Sink $speakers_id)"
else
pactl set-default-sink "$headset_id"
echo "Switched to headset (Sink $headset_id)"
fi
}
generally i try not to use too many custom things because for work i regularly work on all kinds of different servers and i’ve just been too lazy to set up some solution to keep it all in sync. someday…
i use a feature phone / dumbphone that has an sd card slot. load up the sd card with music, and the player is super simple and works great for me. bluetooth earbuds work too, but the rechargable battery of mine died after owning them just a few months longer than the warranty lasted, so i’m back to using wired earbuds (with a usb-c to 3.5mm adapter, do NOT buy the cheap shit from temu, get one that actually sounds decent).
the phone was like $50, and a prepaid sim card inside it makes it so i can use it as cheap backup texting/calling device too when i want to disconnect from all the bullshit the smartphone comes with for a while (still trying to get fully rid of smartphones but it’s very hard these days)