Disable Bluetooth or disconnect Bluetooth connections when lid is closed
Solution 1:
You could install blueutil and SleepWatcher via homebrew and set a .sleep code to do "/usr/local/bin/blueutil -p 0"
when going to sleep mode.
To use SleepWatcher, make a shell script in your home directory named .sleep and give it permission with the chmod command.
You also can do a .wake code to turn bluetooth back on with blueutil -p 1
You can find out how to use sleepwatcher here
Solution 2:
I created a little menubar app which turns off bluetooth when your Mac is sleeping (it's free). Hope it helps!
Solution 3:
I created a script that does all of what @edd-growl mentions above, for you. https://github.com/alb12-la/KBOS