Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (36 sloc) 888 Bytes
#!/bin/sh
#
# Enables the touchpad if and only if there aren't any external mice connected.
#
# Originally from:
#
# https://wiki.archlinux.org/index.php/Touchpad_Synaptics#System_with_multiple_X_sessions
#
# INSTRUCTIONS
# ============
#
# Set TOUCHPAD according to your configuration. To find out (may require root
# privileges):
#
# find /sys/class/input/ -name mouse\* \
# -exec udevadm info --attribute-walk --path={} \; \
# | grep ATTRS{name}
#
TOUCHPAD="SynPS/2 Synaptics TouchPad"
FOUND=0
for MOUSE in `find /sys/class/input -name mouse\*`
do
if [ "`cat $MOUSE/device/name`" != "$TOUCHPAD" ]
then
FOUND=1
break
fi
done
DISPLAY=:0
export DISPLAY
for USER in `w -h | cut -d\ -f1 | sort | uniq`
do
XAUTHORITY=`getent passwd "$USER" | cut -d : -f 6`/.Xauthority
export XAUTHORITY
synclient TouchpadOff=$FOUND
done