Browse Source

Added toggle scripts for touchscreen and trackball

Samuel W. Flint 8 years ago
parent
commit
09eee0ef31
2 changed files with 28 additions and 0 deletions
  1. 14 0
      screentoggle
  2. 14 0
      trackballtoggle

+ 14 - 0
screentoggle

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+declare -i ID
+ID=`xinput list | grep -Eo 'Touch Controller\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+declare -i STATE
+STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
+if [ $STATE -eq 1 ]
+then
+    xinput disable $ID
+    echo "Touchscreen disabled."
+else
+    xinput enable $ID
+    echo "Touchscreen enabled."
+fi

+ 14 - 0
trackballtoggle

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+declare -i ID
+ID=`xinput list | grep -Eo 'Logitech M570\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+declare -i STATE
+STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
+if [ $STATE -eq 1 ]
+then
+    xinput disable $ID
+    echo "Trackball disabled."
+else
+    xinput enable $ID
+    echo "Trackball enabled."
+fi