(i) We have connected a USB mouse, so we do not want to use touchpad for now.
(ii) While typing, there is no use of touchpad, if touchpad is too sensitive, the cursor keeps on jumping due to slight touch of palm or finger.
I have written a script to disable/enable touchpad (which is using synaptics driver).
#!/bin/bash
## Disable touchpad if USB Mouse is attached
SYNAPTICS=`which synclient`
if [[ "$SYNAPTICS" == "" ]]
then
echo "$0: please install synaptics touchpad driver."
echo "Also make sure that 'Option \"SHMConfig\" \"on\"'"
echo " is added in Touchpad device Section in /etc/X11/xorg.conf"
exit
fi
USB_mouse_present=`grep -ic "usb.*mouse" /proc/bus/input/devices`
# if no USB Mouse; enable touchpad
if [ $USB_mouse_present -eq 0 ]
then
$SYNAPTICS TouchpadOff=0
else
$SYNAPTICS TouchpadOff=1
fi
# if any parameter [on|off] is given, override previous command
if [ $# -ge 1 ]
then
if [ "$1" = "on" ]
then
$SYNAPTICS TouchpadOff=0
else
$SYNAPTICS TouchpadOff=1
fi
fi
exit 0
Sample Run:
Turn on touchpad
$ ./touchpad.sh on
Turn off touchpad
$ ./touchpad.sh off
If we have plugged USB mouse, then just give following command
$ ./touchpad.sh
On removing USB mouse, give following, the touchpad will be enabled automatically. :)
$ ./touchpad.sh
PS: The configuration for synaptics driver can be referred from here or here.
7 comments:
thank you a lot, you safed my day :-))
Thanks for the post! Worked great!
Thanks Rainer and Dashie for finding this script useful. :)
It worked perfectly fine. Awesome job.
thank you very much.
Thanks a lot! I can type without any worry now. Seems like we have a new hero!! ^_^
Thanks meant for sharing this type of satisfying opinion, written piece is fastidious, that’s why I’ve read it completely. imac repair
Post a Comment