Run evdevhook2, if you don’t have the correct permissions to access the controller it will tell you that it can’t access /dev/input/event#, where # is a number.
Run this command and change /dev/input/event# with the correct number you just found:
udevadm info -a -p $(udevadm info -q path -n /dev/input/event#)
The command will display a long list of attributes. Identify the name of the input device, in my case it is:
ATTRS{name}=="Nintendo Switch Pro Controller IMU"
Now you can create the udev rule with this command:
sudo nano /etc/udev/rules.d/70-nintendo-switch.rules
Paste the content of the rule:
# Nintendo Switch Pro Controller for evdevhook2
SUBSYSTEM=="input", ATTRS{name}=="Nintendo Switch Pro Controller IMU", TAG+="uaccess"
Edit the ATTRS{name} value if needed, save, exit and reboot.
P.s. You can use the attributes id product and id vendor instead of the device name. In that case the udev rule syntax will be:
SUBSYSTEM=="input", ATTRS{id/product}=="2009", ATTRS{id/vendor}=="057e", TAG+="uaccess"
You can find these attributes in the same way you find the name of the input device. Note that – at least over bluetooth – you have to use ATTRS{id/vendor} and ATTRS{id/product} instead of the more common ATTRS{idVendor} and ATTRS{idProduct}.