Comment 89 for bug 760142

Revision history for this message
hagen (hnieberding) wrote : Re: Several Ubuntu-certified Dell laptops: ImPS/2 ALPS GlidePoint configure as PS/2 mouse instead of proper touchpad

The python scripts of bricedebrignaisplage and Jim Ramsay didn't work for me. I was not in the mood for troubleshooting (I'm sure the problem is not with the scripts, but rather with my installation of python or something!), so I wrote a short script to toggle the touchpad on and off:

#!/bin/bash

# toggle touchpad on/off using xinput

# get device id
ID=$(xinput -list | grep GlidePoint | awk '{ print substr($6,4,2) }')
#echo "ID = $ID"

# read state of device
STATE=$(xinput -list-props $ID | grep 'Device Enabled' | awk '{ print $4 }')
#echo "STATE = $STATE"

# change to other state
if [ $STATE = 0 ]; then
# echo "switching touchpad on"
  xinput set-int-prop $ID "Device Enabled" 8 1
elif [ $STATE = 1 ]; then
# echo "switching touchpad off"
  xinput set-int-prop $ID "Device Enabled" 8 0
else
echo "Error!"
fi
exit 0