-
Touchpad Control
There are two drawbacks to using a laptop: the touchpad and the touchpad.
First, you are typing something and the touchpad decides you've tapped in the secret code for "destroy, destroy, frustration is irrelevant" and whatever it was you were doing is gone.
Second, this still happens even though you've plugged in an external mouse and aren't using the touchpad at all.
The route to solving the first problem is through syndaemon and the route to solving the second is through synclient. Both are command line apps already installed in Knoppix (6.4.4. at least).
To get the right settings automatically when Knoppix start-ups you need an additional script in /etc/X11/Xsession.d and to get the settings to change automagically when you plug-in or unplug a USB mouse, you need to add an extra pair of rules to /etc/udev/rules.d.
There are examples of how to do this out there but they usually start with someone complaining what used to work has stopped and could they crib a new solution from someone who has already done all the hard work.
Seems Knoppix is no exception and none of the solutions out there work. Seems xhost + is missing somewhere for sentimental reasons or perhaps Knoppix is just using a very new X server with new and improved security (the kind that got Windows Vista such a bad name).
Here's my take on this:
Code:
# /etc/udev/rules.d/75-touchpad.rules
# Disable touchpad when USB mouse is plugged in and reenable when USB mouse is removed
ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1", RUN+="/etc/X11/Xsession.d/50touchpad 1"
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1", RUN+="/etc/X11/Xsession.d/50touchpad 0"
# EOF
and
Code:
#!/bin/sh
# /etc/X11/Xsession.d/50touchpad
if pidof X >/dev/null; then
# Turn touchpad off when a USB mouse is present
pidfile=/var/run/syndaemon.pid;
if [ -n "${XAUTHORITY}" ]; then
# Xsession initialisation
if lsusb -v 2>/dev/null | grep -qF Mouse; then
synclient TouchpadOff=1;
else
syndaemon -d -t -k -p $pidfile;
fi
else
# udev hotplug event
DISPLAY=":0";
USER=$(who | awk "/ $DISPLAY /"'{print $1}');
XAUTHORITY=/home/$USER/.Xauthority;
export DISPLAY XAUTHORITY;
synclient TouchpadOff=$1;
if [ "$1" -eq 1 ]; then
[ -f $pidfile ] && kill $(cat $pidfile);
[ -f $pidfile ] && sync;
else
[ ! -f $pidfile ] && syndaemon -d -t -k -p $pidfile;
[ ! -f $pidfile ] && sync;
fi
fi
fi
# EOF
The second must be executable as it is called by the rules in the first.
Enjoy.
Last edited by Forester; 03-17-2011 at 11:30 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
![Apple Computer Vintage sheet of 1990s rainbow logo stickers 2 Sticker Sheet picture](/store/img/g/DCIAAOSwsfdmgYEX/s-l225/Apple-Computer-Vintage-sheet-of-1990s-rainbow-logo.jpg)
Apple Computer Vintage sheet of 1990s rainbow logo stickers 2 Sticker Sheet
$4.80
![Vintage Intel Pentium 200 MMX FV80503200 OEM/Tray Processor picture](/store/img/g/bZwAAOSwNfdmkJNm/s-l225/Vintage-Intel-Pentium-200-MMX-FV80503200-OEM-Tray-.jpg)
Vintage Intel Pentium 200 MMX FV80503200 OEM/Tray Processor
$12.99
![Vintage Dot Matrix Printer Contin Feed Paper 8.5 x 11. Lots of 5 to 250 sheets. picture](/store/img/g/498AAOSwJTdl1MqH/s-l225/Vintage-Dot-Matrix-Printer-Contin-Feed-Paper-8-5-x.jpg)
Vintage Dot Matrix Printer Contin Feed Paper 8.5 x 11. Lots of 5 to 250 sheets.
$4.00
![43 teleprinter vintage 1978 vintage make offer w manual and repair manual picture](/store/img/g/FnQAAOSwZ0ZmkKF~/s-l225/43-teleprinter-vintage-1978-vintage-make-offer-w-m.jpg)
43 teleprinter vintage 1978 vintage make offer w manual and repair manual
$599.00
![Vintage Apple II PLUS Computer System A2S1048 No Monitor picture](/store/img/g/rvAAAOSwythmkHrI/s-l225/Vintage-Apple-II-PLUS-Computer-System-A2S1048-No-M.jpg)
Vintage Apple II PLUS Computer System A2S1048 No Monitor
$249.99
![Vintage Laptop Toshiba Tecra 510CDT Intel Pentium Windows 95. picture](/store/img/g/uAIAAOSwZ~RmkJJN/s-l225/Vintage-Laptop-Toshiba-Tecra-510CDT-Intel-Pentium-.jpg)
Vintage Laptop Toshiba Tecra 510CDT Intel Pentium Windows 95.
$150.00
![Vintage Compaq 141649-004 2 Button PS/2 Gray Mouse M-S34 - FAST SHIPPING - NEW picture](/store/img/g/hxcAAOSwZ~pdrx9T/s-l225/Vintage-Compaq-141649-004-2-Button-PS-2-Gray-Mouse.jpg)
Vintage Compaq 141649-004 2 Button PS/2 Gray Mouse M-S34 - FAST SHIPPING - NEW
$8.99
![Vintage Timex Sinclair 1000 Personal Computer UNTESTED VTG picture](/store/img/g/6rwAAOSwDj9mkGwo/s-l225/Vintage-Timex-Sinclair-1000-Personal-Computer-UNTE.jpg)
Vintage Timex Sinclair 1000 Personal Computer UNTESTED VTG
$45.00
![Vintage Heathkit H8 W Manuals & Cards Video Serial I/O Multi Port Keyboard 16k picture](/store/img/g/rswAAOSwfaRmkJFc/s-l225/Vintage-Heathkit-H8-W-Manuals-Cards-Video-Serial-I.jpg)
Vintage Heathkit H8 W Manuals & Cards Video Serial I/O Multi Port Keyboard 16k
$2994.99
![VINTAGE 2012 LENOVO LABTOP WINDOW 7 picture](/store/img/g/WUwAAOSwZ~RmkFsh/s-l225/VINTAGE-2012-LENOVO-LABTOP-WINDOW-7-.jpg)
VINTAGE 2012 LENOVO LABTOP WINDOW 7
$150.00