Wednesday, February 19, 2014

Disable the trackpad during sleep without X

One of the biggest gripes Chromebook users have reported is that the Chromebook wakes up too easily because of the trackpad. There are multiple solutions for this if you're running CrOS or X11, but if you're often using just the console, tricks like xinput and Chrosh's tpcontrol don't work.

But all is not.. naught! You can use the same technique described here for USB devices. First you need the identifier for the trackpad, though, which doesn't show up using lsusb.

You'll find your trackpad's identifier under /sys/bus/i2c/drivers/cyapa -- there should be a directory there called something like 1-0067. That's the identifier:

root@calculon:/sys/bus/i2c/drivers/cyapa$ ls
1-0067 bind  uevent  unbind

Next, using the trick from the above post, create a new script in /etc/pm/sleep.d. The file should contain:

#!/bin/bash
case $1 in
    hibernate|suspend)
        echo '1-0067' | tee /sys/bus/i2c/drivers/cyapa/unbind
    ;;
    thaw|resume)
        echo '1-0067' | tee /sys/bus/i2c/drivers/cyapa/bind
        ;;
    *)
        echo "Somebody is calling me totally wrong."
    ;;
esac

Moar battery life for all!

No comments:

Post a Comment