Skip to content

Instantly share code, notes, and snippets.

@fidelisrafael
Last active November 20, 2017 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fidelisrafael/56d954c2627eabfad3321e4a50e237e8 to your computer and use it in GitHub Desktop.
Save fidelisrafael/56d954c2627eabfad3321e4a50e237e8 to your computer and use it in GitHub Desktop.
Disable touchscreen on OpenSuse Leap 42.2 and others linux distros (ATTENTION: You must install `xinput` package for your distro) Original: https://ubuntuforums.org/showthread.php?t=2100744
#! /bin/bash
# switch_touchscreen.sh
# https://ubuntuforums.org/showthread.php?t=2100744
# Use `xinput --list` to list all devices and find your touchscreen
# sudo chmod a+x switch_touchscreen.sh
DEVICE="Atmel Atmel maXTouch Digitizer"
STATUS=`xinput list-props "$DEVICE" | grep 'Device Enabled' | sed 's/.*\([0-9]\)$/\1/'`
if [ "$STATUS" = "1" ]
then
xinput disable 'Atmel Atmel maXTouch Digitizer'
echo "Touch-screen disabled"
elif [ "$STATUS" = "0" ]
then
xinput enable 'Atmel Atmel maXTouch Digitizer'
echo "Touch-screen enabled"
else
echo "Error : bad argument"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment