#!/bin/bash while true do if [ -e ~/.touchpad.on ]; then synclient TouchpadOff=0 else if [ -e ~/.touchpad.off ]; then synclient TouchpadOff=1 else if [ "`grep -e Mouse /proc/bus/usb/devices`" ]; then synclient TouchpadOff=1 else synclient TouchpadOff=0 fi fi fi sleep 3 done