mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-31 14:55:03 +08:00
feat: adds hidname script to get the name of hidraw devices
This commit is contained in:
parent
bca833bffd
commit
ee7748c7b5
2 changed files with 10 additions and 0 deletions
8
modules/home/scripts/scripts/hidname.sh
Executable file
8
modules/home/scripts/scripts/hidname.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue