Listen to Bluetooth events and run custom scripts
Monitor Bluetooth events and run custom scripts
Code for this answer.
Originally from here by Douglas6 written for Raspberry Pi.