:: Re: [DNG] Disabling touchpad
Góra strony
Delete this message
Reply to this message
Autor: dng@d404.nl
Data:  
Dla: dng
Temat: Re: [DNG] Disabling touchpad
On 28-12-2020 12:42, Hendrik Boom wrote:
> On Mon, Dec 28, 2020 at 09:39:04AM +0100, Didier Kryn wrote:
>> Le 27/12/2020 à 21:55, Steve Litt a écrit :
>>> On Sun, 27 Dec 2020 10:20:04 -0500
>>> Hendrik Boom <hendrik@???> wrote:
>>>
>>>> My touchpad is absurdly sensitive, and I keep brushing against it by
>>>> accident. I don't feel the touch at all, but the computer sure does.
>>>> It can hapen while I'm typing and suddenly my text edit turns into a
>>>> shell command in a newsly chosen window.
>>>> I suspect even a few beard hairs can activate it.
>>>>
>>>> Now I usually use a wireless mouse on this computer though
>>>> occasionally the mouse fails (usually low battery) an then I do want
>>>> the touchpad.
>>>>
>>>> Is there any way to disable the touchpad normally, but to reactivate
>>>> it easily when the mouse fails?
>>> Yes!
>>>
>>> The attached touchtoggle.sh should fulfill your exact needs. Just
>>> associate it with a convenient hotkey.
>>>
>>> For convenience I'm also putting it in the body, but use it from the
>>> attachment: I have no idea what email clients do to the characters in
>>> the file:
>>>
>>> ======================================================
>>> #!/bin/sh
>>>
>>> # touchtoggle.sh Copyright (C) 2019 by Steve Litt
>>> # All rights reserved.
>>> # Licensed via the
>>> # Expat license: https://directory.fsf.org/wiki/License:Expat
>>>
>>> # FIRST GET DEVICE'S DEVICE ID CONTAINING CASE INSENSITIVE "TOUCHPAD"
>>> devid=`xinput | grep -i touchpad | \
>>> sed -e"s/.*id=//" | sed -e"s/\s.*//"`
>>>
>>> # WITH THAT DEVICE ID, FIND EVERYTING ABOUT PROPERTY
>>> # CONTAINING CASE INSENSITIVE "DEVICE ENABLED"
>>> scratchline=`xinput --list-props 11 | \
>>> grep -i "device enabled" | \
>>> sed -e"s/^\s*//" | sed -e"s/\s*$//"`
>>> proptext=`echo $scratchline | sed -e"s/\s*(.*//"`
>>> propid=`echo $scratchline | sed -e"s/.*(//" | sed -e"s/).*//"`
>>> currstate=`echo $scratchline | sed -e"s/.*):\s*//"`
>>>
>>> # DIAGNOSTICS, COMMENT OUT WHEN FULLY FUNCTIONAL
>>> echo diagnostic devid      =$devid
>>> echo diagnostic scratchline=$scratchline
>>> echo diagnostic proptext   =$proptext#
>>> echo diagnostic propid     =$propid

>>>
>>> # TOGGLE CURRSTATE VARIABLE
>>> echo -n "Current state of $currstate "
>>> if test "$currstate" = "1"; then
>>>     currstate=0
>>> else
>>>     currstate=1
>>> fi
>>> echo has been changed to $currstate.

>>>
>>> # IMPLEMENT THE PROPERTY VALUE CHANGE
>>> xinput set-prop $devid $propid $currstate
>>>
>>> # UNCOMMENT FOLLOWING LINE IF PROPERTY ID STOPS WORKING
>>> #xinput set-prop $devid "$proptext" $currstate
>>>
>>> ======================================================
>>>
>>> I've had several versions of this shellscript, so please let me know
>>> whether it works for you.
>>     Note you might as well open your laptop and unplug the touchpad.
>> Just search for a tutorial on how to change it.
>>
>> --         Didier
> Yes, in principle. The times I need my touchpad are
> * when my mouse battery runs out and I don't have a new one at hand
> * when my mouse mysteriously fails
> * when I'm travelling and I've forgotten my mouse
> etc.
> In few of these cases is it practical to take my computer apart and
> reconnect the touchpad,
> but it can be easy to run a shell command after hitting control-alt-F1
> and logging in.
>
> -- hendrik


Depending on your hardware and driver the easiest solution is to
blacklist the synaptics driver and modprobe it by hand whenever necessary.

Grtz

Nick