[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

SOLVED?? Re: Touchpad Synaptics changes name after resume



Am 05/12/2022 um 15:09 schrieb David Wright:
On Mon 05 Dec 2022 at 10:08:45 (+0000), Ottavio Caruso wrote:
Op 03/12/2022 om 16:05 schreef David Wright:
On Sat 03 Dec 2022 at 10:37:50 (+0000), Ottavio Caruso wrote:
$ uname -a
Linux t440 6.0.0-0.deb11.2-amd64 #1 SMP PREEMPT_DYNAMIC Debian
6.0.3-1~bpo11+1 (2022-10-29) x86_64 GNU/Linux

I have two scripts that enable/disable touchpad that I mapped to some
keyboard shortcuts:

$ cat ~/opt/bin/touchpad-on
xinput enable "SynPS/2 Synaptics TouchPad"
$ cat ~/opt/bin/touchpad-off
xinput disable "SynPS/2 Synaptics TouchPad"

The problem is that xinput(1) changes the name of the touchpad every
now and again:

$ dmesg| grep -i synaptics |grep "as /devices"
[463340.358242] input: Synaptics TM2722-001 as
/devices/pci0000:00/0000:00:1f.3/i2c-0/0-002c/rmi4-00/input/input319
[505228.803682] input: SynPS/2 Synaptics TouchPad as
/devices/platform/i8042/serio1/input/input335
[505234.019989] input: SynPS/2 Synaptics TouchPad as
/devices/platform/i8042/serio1/input/input338

That is, it alternates between "Synaptics TM2722-001" and "SynPS/2
Synaptics TouchPad".

Even the id changes. Sometimes it's 11, some other times it's 10 or 9.

As a workaround, how about trying:

    $ cat ~/opt/bin/touchpad-on
    xinput enable "SynPS/2 Synaptics TouchPad"
    xinput enable "Synaptics TM2722-001"
    $ cat ~/opt/bin/touchpad-off
    xinput disable "SynPS/2 Synaptics TouchPad"
    xinput disable "Synaptics TM2722-001"



$   xinput enable "SynPS/2 Synaptics TouchPad"
$  xinput enable "Synaptics TM2722-001"
unable to find device Synaptics TM2722-001
$

So that's not an option.

That /was/ the idea, if and when the device woke up
thinking it was a SynPS/2 Synaptics TouchPad.

And, on the occasions when it woke up thinking it
was a Synaptics TM2722-001, you'd expect to get:

   $   xinput enable "SynPS/2 Synaptics TouchPad"
   unable to find device SynPS/2 Synaptics TouchPad
   $  xinput enable "Synaptics TM2722-001"
   $

After all, the one device is not going to have both
names at the same time, unless some sort of aliasing
mechanism was in play.

The workaround was to save you the bother of testing
between the two names. To do the job properly, your
script would have to be dynamic, finding the touchpad
before en/disabling it. My own script is outlined in

https://lists.debian.org/debian-user/2022/10/msg00358.html

and it handles whatever devices are plugged into whichever
of my computers at the instant it runs. (The names don't
vary here, but my devices do get swapped around.)

For posterity:

$ xinput enable "$(xinput list --name-only | grep -i Synaptics)"

and

$ xinput disable "$(xinput list --name-only | grep -i Synaptics)"

Both seem to work, fingers crossed.


--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Reply to: