-
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
![Genuine OEM Samsung Galaxy Tab S6 Lite Book Cover -NEW EF-BP610PJEGUJ- #E4 picture](/store/img/g/eO0AAOSwbkllzTa3/s-l225/Genuine-OEM-Samsung-Galaxy-Tab-S6-Lite-Book-Cover-.jpg)
Genuine OEM Samsung Galaxy Tab S6 Lite Book Cover -NEW EF-BP610PJEGUJ- #E4
$10.00
![Samsung - S Pen Creator Edition - White picture](/store/img/g/nicAAOSwg8Nl-6GK/s-l225/Samsung-S-Pen-Creator-Edition-White.jpg)
Samsung - S Pen Creator Edition - White
$38.00
![SAMSUNG 850 EVO 500GB 2.5](/store/img/g/tqMAAOSwABBmbZba/s-l225/SAMSUNG-850-EVO-500GB-2-5-SATA-SSD-MZ-75E500-Grade.jpg)
SAMSUNG 850 EVO 500GB 2.5" SATA SSD MZ-75E500, Grade A SKU 10171
$28.99
![Samsung Galaxy Tab A9+ 11.0](/store/img/g/qbUAAOSw1o1l1Rtt/s-l225/Samsung-Galaxy-Tab-A9-11-0-64GB-Gray-Wi-Fi-Tablet-.jpg)
Samsung Galaxy Tab A9+ 11.0" 64GB Gray Wi-Fi Tablet Bundle SM-X210NZAYXAR 2023
$149.99
![256gb SSD SATA Hard Drive Samsung 850 Pro MZ7KE256 picture](/store/img/g/ywkAAOSw8v9mbwBn/s-l225/256gb-SSD-SATA-Hard-Drive-Samsung-850-Pro-MZ7KE256.jpg)
256gb SSD SATA Hard Drive Samsung 850 Pro MZ7KE256
$20.00
![Samsung Galaxy Tab A9 (X110) 64GB 4GB RAM International Version (New) picture](/store/img/g/cKIAAOSwGyBl1PaA/s-l225/Samsung-Galaxy-Tab-A9-X110-64GB-4GB-RAM-Internatio.jpg)
Samsung Galaxy Tab A9 (X110) 64GB 4GB RAM International Version (New)
$126.99
![OEM SAMSUNG Keyboard FOR Galaxy Tab S8+, S7 FE, S7+ Lite w/ Large Key SIZE picture](/store/img/g/~m4AAOSwaGJhlWFS/s-l225/OEM-SAMSUNG-Keyboard-FOR-Galaxy-Tab-S8-S7-FE-S7-Li.jpg)
OEM SAMSUNG Keyboard FOR Galaxy Tab S8+, S7 FE, S7+ Lite w/ Large Key SIZE
$46.99
![samsung galaxy tab s6 lite 2024 Brand New Sealed SM-P620 picture](/store/img/g/9Z8AAOSw2Y1mbeJa/s-l225/samsung-galaxy-tab-s6-lite-2024-Brand-New-Sealed-S.jpg)
samsung galaxy tab s6 lite 2024 Brand New Sealed SM-P620
$219.99
![Set Of 10 Samsung (1 x 8GB) PC4-21300 So DIMM So(DDR4-2666) Memory - SET OF 10 picture](/store/img/g/5KEAAOSweStmaLT6/s-l225/Set-Of-10-Samsung-1-x-8GB-PC4-21300-So-DIMM-So-DDR.jpg)
Set Of 10 Samsung (1 x 8GB) PC4-21300 So DIMM So(DDR4-2666) Memory - SET OF 10
$100.00
![Samsung Book Cover Keyboard For Galaxy Tab S9+ S9 FE+ EFDX815UBEGUJ NICE USED picture](/store/img/g/Od4AAOSw2bdmDZDy/s-l225/Samsung-Book-Cover-Keyboard-For-Galaxy-Tab-S9-S9-F.jpg)
Samsung Book Cover Keyboard For Galaxy Tab S9+ S9 FE+ EFDX815UBEGUJ NICE USED
$129.99