Automatically run script when specific device is connected?

Hi all,

Pretty straightforward question: I would like my OS to automatically execute a shell script (example name: test_script.sh) every time a device with a specific name is connected (for example this microphone called Beyerdynamic FOX):
image
(screenshot from xinput list output)

I cannot guarantee that the device will always have the same ID as I’ve seen different devices take different IDs at different times when they are connected.

Thanks in advance!

Make sure you get the device’s correct parameters with lsusb and then create a udev rule for it in /etc/udev/rules.d/.

2 Likes

Yep, this was exactly what I was looking for. Thank you!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.