I have a script that I wish to run whenever I plug/unplug a mouse or keyboard to my USB port.
There is already plenty of documentation on how to configure udev rules to run arbitrary scripts when a device is plugged or unplugged. But configuring those rules requires root permissions. And, although I do have root access on my machine, I'm looking for a solution that does not require sudo, root, or writing udev rules. (why? because it will be easier to run, maintain and distribute)
Most likely, the solution will use dbus, but I might be mistaken.
(By the way, I'm and advanced user and former Gentoo user, feel free to spit out technical details!)
Solutions that require root:
- Autorun a script after I plugged or unplugged a USB device
- http://hg.dfrank.ru/linux/my-udev-notify (from this question/answer)
Seemingly outdated solutions that don't need root: