NewsEntries /110828PhantomActionsWithClosedLid

Phantom actions with closed (netbook-)lid

My Eeepc 1015PN exhibits some strange behaviour when the lid is closed. I open it again, only to find newly created folders, last night "the phantom" even went through my panel and deleted all network applications.

Long story short, the touchpad seems to be pretty sensitive and all symptoms can be traced back to a couple of hours of bogus input data.

Conclusion: We need to turn the touchpad off when the lid is closed

/usr/bin/lidtouchpadfix
#!/bin/bash

# Small fix for turning off the touchpad when the lid is closed.
# License: GPLv2
# Author: Jörg Eitemüller <destotelhorus@googlemail.com>

# XINPUT_DEVICE can be obtained by typing xinput list, then take the id of the touchpad device in question.
#  Example:
#  ⎜   ↳ ETPS/2 Elantech Touchpad                   id=14   [slave  pointer  (2)]
#   The id would in this case be 14
XINPUT_DEVICE=14

# XINPUT_PROPERTY can be obtained by typing xinput list-props $XINPUT_DEVICE, then take the id of the property named "Off" or "Synaptics Off"
#  Example:
#       Synaptics Off (275):    0
#   The id would in this case be 275
XINPUT_PROPERTY=275

LIDSTATE="unknown"
while true; do
        grep -q 'closed$' /proc/acpi/button/lid/LID/state 1>/dev/null 2>&1
        GREPRET=$?
        if ( [ "$GREPRET" -eq "0" ] && [ "$LIDSTATE" != "CLOSED" ] ); then
                #echo Turning the touchpad off
                xinput set-prop $XINPUT_DEVICE $XINPUT_PROPERTY 1
                LIDSTATE="CLOSED"
        elif ( [ "$GREPRET" -ne "0" ] && [ $LIDSTATE != "OPEN" ] ); then
                #echo Turning the touchpad on
                xinput set-prop $XINPUT_DEVICE $XINPUT_PROPERTY 0
                LIDSTATE="OPEN"
        fi
        sleep 1
done

Start this automatically with your X-session and expell the ghosts :-)

dth? August 28, 2011, at 11:50 UTC