Created
September 13, 2023 16:46
-
-
Save InvertedAcceleration/996c1b14902736081b882bffe4a70d6f to your computer and use it in GitHub Desktop.
Enable VIA (https://usevia.app/) access to Keychron keyboards in Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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