Skip to content

Instantly share code, notes, and snippets.

@mixalbl4-127
Created December 29, 2021 12:30
Show Gist options
  • Save mixalbl4-127/d7391ee114d22eacc4b2eac750f53c42 to your computer and use it in GitHub Desktop.
Save mixalbl4-127/d7391ee114d22eacc4b2eac750f53c42 to your computer and use it in GitHub Desktop.
sleep 5
for Id in $(xinput --list | grep "A4TECH USB" | grep -oE "id=[0-9]{1,2}" | grep -oE "[0-9]{1,2}")
do
#if [ "$(xinput --list-props $Id | grep -oE "\"Rel Horiz Wheel\"")" ]
if [ "$(xinput --list-props $Id | grep -oE "Button Scrolling Button Default")" ]
then
buttonId=$Id
fi
done
sleep 5
xinput --disable $buttonId
sleep 5
tEvent=$(xinput --list-props $buttonId | grep -oE "event+[0-9]{1,3}")
pkill -f -9 "evtest /dev/input/$tEvent"
evtest /dev/input/$tEvent | awk '/KEY_LEFTMETA), value 1/ {system("xdotool click --repeat 2 1")}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment