Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tripurari001/4088c35b54a84ad381d664f9f2f7606a to your computer and use it in GitHub Desktop.

Select an option

Save tripurari001/4088c35b54a84ad381d664f9f2f7606a to your computer and use it in GitHub Desktop.
Give permission for WebHiD to modify keyboard using usevia.app
#!/bin/bash
# can change the device name here
HID_NAME='Keychron Keychron K2 Pro'
# loop over possible devices
for f in /dev/hidraw*
do
DEVICE_NAME=$(basename ${f})
if grep "$HID_NAME" "/sys/class/hidraw/${DEVICE_NAME}/device/uevent";
then
# device matches product name
echo Running sudo chmod a+rw "$f"
sudo chmod a+rw "$f"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment