Device connection triggers (ie: usb)

Would it be possible to have triggers when a specific usb (or other) device is connected.

My use case for this is to run some adb commands (and scrcpy) when connecting android phone.

Could be interesting also being able to specify a log file and have btt trigger when a new log entry matches some regex or string. (think that would also allow to run triggers when usb device is connected but with more manual work). Worth raising a separate feature request for that?

I have the same issue. I want scrcpy to start the moment I connect an android phone. Tried using an Alfred workflow. Reddit suggests 'Keyboard Maestro'. Never heard of that, but I hoped to not get another app to get what I want...

I'll add USB Device Connected / Disconnected triggers with the next alpha, maybe tomorrow.


whoah that would be so cool! I'll look into how to get the alpha and see if I can test it out

v4.408 alpha (uploading now) has basic USB Device Connect / Disconnect Triggers:

1 Like

Thanks for building the USB triggers. The use case I have in mind is to set different sound profiles in Soundsource based on the type of headphones connected.

Currently whenever my external sound interface is connected through USB a shortcut is executed and the right Soundsource profile is selected based on connect or disconnect.

However, 1 pair of headphones is connected over bluetooth. Any plans to support bluetooth triggers?

I added bluetooth connect / disconnect as well in 4.425 alpha. Best use the bluetooth address of the device as the name seems to be unreliable.

Works very well! Thanks!