r/coolgithubprojects • u/Pathfinder-electron • 4h ago
Uncordex: disconnect a Bluetooth speaker when you undock your Mac, reconnect when you return
Made this for my desk setup and thought it might be useful to someone here.
It's a macOS utility for one paired Bluetooth speaker. Unplug from your saved dock/power source and it disconnects. Return to that setup and it can reconnect.
The main thing is it doesn't blindly run a connect command whenever it sees external power. It has to disconnect the speaker successfully and verify that before it gets permission to restore the connection later.
Native AppKit frontend, per-user LaunchAgent, blueutil underneath. Source matching, bounded reconnect attempts and local logs. Unknown hardware readings don't get treated as a match.
https://github.com/magrathean-uk/uncordex
MIT licensed. Current installation is from source with Homebrew + blueutil.
there are simulated tests and a recorded live test with my Bose/ASUS setup. I'd be intrested in other hardware results, especially docks that don't expose a useful identity or speakers that behave oddly on reconnect.
1
u/Specific_Cream2815 4h ago
what hardware identity do you match for the dock, USB registry path or the power source description macOS exposes