I trying to configure my laptop's touchscreen + stylus so that the touch device is turned off when the stylus is detected, so that I can rest my hand on the screen while writing. I can write a script that does this by checking for 'proximity' in the xinput output, but this script would have to check a few times per second to have a good response time.I was wondering whether the stylus proximity generates an event that can be captured somehow to avoid watching the xinput output all the time... I don't see anything in acpi_listen. Any hints?Thanks,Stefano
Are any events generated when stylus proximity is detected?
xinput;touch screen
The following works for me:STYLUS_ID=11 # replace with ID or name of your stylusTOUCH_ID=9 # replace with ID or name of your touch screenxinput test -proximity $STYLUS_ID |    while read line; do        if [[ $line == *out* ]]; then            xinput enable $TOUCH_ID        else            xinput disable $TOUCH_ID        fi    doneInstead of polling the state of the stylus, it relies on the option test of xinput, which enters an endless loop displaying proximity events for the device. From xinput's man page:    test [-proximity] device           Register all extended events from device and enter an endless loop           displaying events received. If the -proximity is given, ProximityIn           and ProximityOut are registered.