Skip to content

Instantly share code, notes, and snippets.

@InvertedAcceleration
Created September 13, 2023 16:46
Show Gist options
  • Save InvertedAcceleration/996c1b14902736081b882bffe4a70d6f to your computer and use it in GitHub Desktop.
Save InvertedAcceleration/996c1b14902736081b882bffe4a70d6f to your computer and use it in GitHub Desktop.
Enable VIA (https://usevia.app/) access to Keychron keyboards in Linux
#!/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)"
if [[ "$DEVICE" == *"Keychron"* ]]; then
echo "Enabling VIA access for $DEVICE."
chmod a+rw /dev/$FILE
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment