Last active
August 15, 2024 21:37
-
-
Save D-Brox/b3ca4e00b0b429601a647bbb946d4783 to your computer and use it in GitHub Desktop.
Script for disabling touchscreen on linux (by kidnapping the input with evtest)
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/env bash | |
device=$( cat /proc/bus/input/devices | | |
gawk ' | |
/"ELAN Touchscreen"/{ inside = 1 } | |
/Handlers=/ { if(match($0,"event([0-9]+)",group))event = group[1] } | |
/^$/ { if(inside && event!="")print "/dev/input/event" event | |
inside = 0; event = "" | |
}') | |
if [ -n "$device" ]; then | |
evtest --grab "$device" > /dev/null & | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment