#!/bin/bash

# This script is for toggling a laptop touchpad on and off, for
# example from FVWM. It assumes the synaptics driver is used
# and that synclient is installed. If not, the below commands
# for xinput might work, but YMMV.
# This script is (L) copyleft and comes with no warranty whatsoever.
# xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
# xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1

tp_result=`synclient|grep TouchpadOff|awk '{print $3}'`
if [ "$tp_result" -eq "1" ]
then # touchpad is off, turn on
    synclient TouchpadOff=0
else # touchpad is on, turn off
    synclient TouchpadOff=1
fi
