detect thunderbolt display connection and switch bluetooth accordingly I have a thunderbolt display that I use as a docking station with wireless keyboard and mouse.

Is there a way to turn on bluetooth when connecting the display and turn it off when disconnecting the display?
ControlPlane can do what you want. It's pretty versatile, but you can certainly build a rule that will turn on your Bluetooth when a specific display is attached.