Skip to content

Instantly share code, notes, and snippets.

@fidelisrafael
Created November 20, 2017 23:40
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/29e079d3b2c69fca4e8425b72f86d576 to your computer and use it in GitHub Desktop.
Save fidelisrafael/29e079d3b2c69fca4e8425b72f86d576 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)
#! /bin/bash
# switch_touchscreen.sh
# https://ubuntuforums.org/showthread.php?t=2100744
# 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