Skip to content

Instantly share code, notes, and snippets.

@D-Brox
Created January 31, 2024 13:16
Show Gist options
  • Save D-Brox/b3ca4e00b0b429601a647bbb946d4783 to your computer and use it in GitHub Desktop.
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)
#! /bin/env bash
device=$( cat /proc/bus/input/devices |
awk '
/"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