Skip to content

Instantly share code, notes, and snippets.

@BrandowLucas
Created March 18, 2026 18:03
Show Gist options
  • Select an option

  • Save BrandowLucas/13f20d9a7e400e96cba009ea3a64621e to your computer and use it in GitHub Desktop.

Select an option

Save BrandowLucas/13f20d9a7e400e96cba009ea3a64621e to your computer and use it in GitHub Desktop.
Fix: USB HID devices not detected in browser (Linux udev script)
#!/bin/bash
GREEN='\033[0;32m'
NC='\033[0m'
RULES_FILE="/etc/udev/rules.d/50-chromium-hid.rules"
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)."
exit 1
fi
echo "Creating udev rules at $RULES_FILE..."
cat <<EOF > "$RULES_FILE"
# Grant access for all USB devices (HIDs) to the 'plugdev' group
# Replace 'plugdev' with your user's group if you don't use plugdev.
SUBSYSTEM=="usb", MODE="0666"
SUBSYSTEM=="hidraw", MODE="0666"
EOF
echo "Reloading udev rules..."
udevadm control --reload-rules
udevadm trigger
echo -e "${GREEN}Done! Your HID permissions have been updated.${NC}"
echo "Your devices should now be detected in your browser!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment