Created
August 13, 2021 15:46
-
-
Save martonmiklos/92f8f5f1a7c8d28c1ae885ce342ca181 to your computer and use it in GitHub Desktop.
Force us layout for athe Chinayoko E1005 barcode reader module
This file contains 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
ACTION=="bind" SUBSYSTEMS=="usb", ATTRS{idVendor}=="6778", ATTRS{idProduct}=="0112", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/mm/.Xauthority", RUN+="/etc/udev/rules.d/fix_barcode_layout.sh" |
This file contains 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 | |
usbkbd=`xinput -list | grep -c "HID Keyboard Device HID Keyboard Device"` | |
if [[ "$usbkbd" -gt 0 ]] | |
then | |
usbkbd_ids=`xinput -list | grep "HID Keyboard Device HID Keyboard Device" | awk -F'=' '{print $2}' | cut -c 1-2` | |
usbkbd_layout="us" | |
for ID in $usbkbd_ids | |
do | |
setxkbmap -device "${ID}" -layout "${usbkbd_layout}" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment