Originally Posted by
Favux
Hi Pikachuu,
Right. Putting a file in tmp is just a dodge to get around the fact that we don't know yet how to directly query the system as to whether evdev touch is off or on for "N-Trig Touchscreen".
Here is another way of doing it where it will check to see if the device is floating or not:
Code:
#!/bin/bash
# evdev touch toggle script
xinput --list|grep "N-Trig MultiTouch"|grep "floating slave" > /dev/null
TOUCH_ON=$?
if [ $TOUCH_ON -eq 1 ];then
xinput float "N-Trig Touchscreen"
else
xinput reattach "N-Trig Touchscreen" "Virtual core pointer"
fi
The xinput --list will list out the devices and the greps will look for a line that contains the N-Trig MultiTouch and floating slave words. If it finds a match, it means that touch is off. Otherwise touch is on.
Bookmarks