Skip to content

Instantly share code, notes, and snippets.

@zieru
Created June 19, 2022 13:50
Show Gist options
  • Select an option

  • Save zieru/eec780b36dd056c15e892fbc36a8c06d to your computer and use it in GitHub Desktop.

Select an option

Save zieru/eec780b36dd056c15e892fbc36a8c06d to your computer and use it in GitHub Desktop.
#!/bin/bash
FILES=/dev/hidraw*
for f in $FILES
do
FILE=${f##*/}
DEVICE="$(cat /sys/class/hidraw/${FILE}/device/uevent | grep HID_NAME | cut -d '=' -f2)"
printf "%s \t %s\n" $FILE "$DEVICE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment