Skip to content

Instantly share code, notes, and snippets.

@henriquegogo
Created August 15, 2018 03:50
Show Gist options
  • Save henriquegogo/990849f1a573f4a4e49f7c87d2c1ea3a to your computer and use it in GitHub Desktop.
Save henriquegogo/990849f1a573f4a4e49f7c87d2c1ea3a to your computer and use it in GitHub Desktop.
udev - Detect USB device and launch an action
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="nanoKEY2", TAG+="systemd", ENV{SYSTEMD_WANTS}="midi-keyboard-drums.service"
SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_MODEL}=="nanoKEY2", RUN+="/usr/bin/killall fluidsynth"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="UMX_61", TAG+="systemd", ENV{SYSTEMD_WANTS}="midi-keyboard-rhodes.service"
SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_MODEL}=="UMX_61", RUN+="/usr/bin/killall fluidsynth"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="nanoKEY2", RUN+="/usr/bin/killall emulationstation"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="UMX_61", RUN+="/usr/bin/killall emulationstation"
[Service]
Type=forking
ExecStart=/home/pi/Soundfonts/load "/home/pi/Soundfonts/files/Sonic Implants Blue Jay Drums.sf2"
[Service]
Type=forking
ExecStart=/home/pi/Soundfonts/load /home/pi/Soundfonts/files/jRhodes3c-stereo.sf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment