Disable Bluetooth or disconnect Bluetooth connections when lid is closed A case in point: I have Bluetooth headphones connected to my MacBook Pro, I close the lid and want to connect headphones to my iPhone. I can't do that because the MBP ↔ headphones connection is still persisted.

How do I configure macOS so that Bluetooth is turned off or Bluetooth connections are disconnected whenever lid is closed?

I'm using macOS Mojave 10.14.5.
I created a little menubar app which turns off bluetooth when your Mac is sleeping (it's free). Hope it helps!