Browse Source

Updated the regex for finding the id of the touchpad

Samuel W. Flint 7 years ago
parent
commit
b8fa9af1f4
3 changed files with 4 additions and 4 deletions
  1. 1 1
      touchoff
  2. 1 1
      touchon
  3. 2 2
      touchtoggle

+ 1 - 1
touchoff

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 declare -i ID
-ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+ID=`xinput list | grep -Eio 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
 
 xinput disable $ID
 echo "Touchpad disabled"

+ 1 - 1
touchon

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 declare -i ID
-ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+ID=`xinput list | grep -Eio 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
 
 xinput enable $ID
 echo "Touchpad enabled."

+ 2 - 2
touchtoggle

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 declare -i ID
-ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+ID=`xinput list | grep -Eio 'Touchpad\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 ]
@@ -11,4 +11,4 @@ then
 else
     xinput enable $ID
     echo "Touchpad enabled."
-fi
+fi