Lubuntu18.04: how to save touchpad settings?

@wxl: I am so frustrated that I forgot to thank you for your very detailed explanations, Thank you :slight_smile:
“Pearls before swine”

@wxl: Touchpad script

Found a solution but it works not always: Why?

Your script

     # Turn it on
      xinput set-prop "$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)" "Tapping Enabled" 1  

doesn not work properly in my case, because of two “Tapping Enabled” lines in my touchpad list, see here:

    Device 'ETPS/2 Elantech Touchpad':
            Device Enabled (151):   1
            Coordinate Transformation Matrix (153): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
            libinput Tapping Enabled (307): 0
            libinput Tapping Enabled Default (308): 0

So, I changed it to

xinput set-prop "$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)" "Tapping Enabled (" 1

This worked fine for some time, being able to change Tap on/Tap off just replacing 1 with 0 and vice versa). But now it does not anymore, it does not tap on, and there is an errotmodification, see later :

Response after running the script:

    property 'Tapping Enabled (' doesn't exist, you need to specify its type and format

This is eve more strange sice hte property “Tapping Enabled” is correctly found in my test script, i.e., both numbers correctly turn out, MY_TOUCHPAD_ID and MY_TOUCHPAD_STATE, 13 and 0 (iTap off, the latter):

    #!/bin/bash

    # Turn it on

    MY_TOUCHPAD_ID="$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)"

    MY_TOUCHPAD_STATE="$(xinput list-props $MY_TOUCHPAD_ID | grep -i "Tapping Enabled (" | cut  -f3)"

    echo $MY_TOUCHPAD_ID
    echo $MY_TOUCHPAD_STATE

    read -p "Press [Enter] key to continue..."

    # This is your original
    # xinput set-prop "$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)" "Tapping Enabled" 1

    # This is my modification
    xinput set-prop "$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)" "Tapping Enabled (" 1

    # xinput set-prop $MY_TOUCHPAD_ID $MY_TOUCHPAD_STATE 1

    echo $MY_TOUCHPAD_ID
    echo $MY_TOUCHPAD_STATE

    read -p "Press [Enter] key to continue..."

When I run it now I get:

    13
    0
    Press [Enter] key to continue... property 'Tapping Enabled (' doesn't exist, you need to specify its type and format
    13
    0

13 and 0 are correct, but why “doesn’t exist,…”
What could be wrong?

Thanks, lubucub

Finally solved, and it is rebootproof :joy:

These are the 4 essential lines of the TapToClickOn-script for Lubuntu 19.04:

    MY_TOUCHPAD_ID="$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)"

    TOUCHPAD_STATE="$(xinput list-props $MY_TOUCHPAD_ID | grep -i "Tapping Enabled (" | cut -d '(' -f2)"

    MY_TOUCHPAD_STATE="${TOUCHPAD_STATE:0:3}"

    xinput set-prop $MY_TOUCHPAD_ID $MY_TOUCHPAD_STATE 1

To set TapOff just replace 1 with 0

I’m really confused as to why you’re searching for “Tapping Enabled (” and not “Tapping Enabled,” but I see how you worked around it to get it there, and managed some more high-level scripting, too. Good work!

@wxl:
Thanks, and quite simple: without “(” I get a longer string to slice, e.g.,
289): 1 290): 0
i.e., the first plus the second line’s information
while with " (" I get the shorter information from the first line only
289): 1
That’s all, nothing special about it, just my curiosity how to handle this tricky business in different ways.

Oh, I see the issue. You’re trying to get the ID of the property. Originally I suggested that using the name of the property rather than the ID would be more general and would be less likely to get you in trouble. The problem was my assumption that the property was called “Tapping Enabled” when it’s actually “libinput Tapping Enabled.” If you used that, it would likely be better.

@wxl

Thank you, works perfect now:

#!/bin/bash

# Turn it on
xinput set-prop "$(xinput list | grep -i touchpad | cut -d'=' -f2 | cut -d$'\t' -f1)" "libinput Tapping Enabled" 1
1 Like

This question by lubucub highlights a severe weakness of Lubuntu, in that there is no GUI for touchpad settings or mouse double-click times etc.

Surely, the simplest answer to the question is to add the command to Autostart in the LXSession Configuration GUI in the Preferences menu?

1 Like

This is a severe weakness only of LXDE. If you read the entire thread, you’ll notice the next version of Lubuntu will contain a fix for LXQt.

This brings me to the point I’ve been saying over and over and over again: DON’T USE 18.04/LXDE and instead upgrade to 19.04+/LXQt. LXDE is dead. I don’t care what people say. The upstream developers are not fixing bugs, let alone adding features. That’s de facto dead.

The original question referred to 18.04, and there are many good reasons for LTS users not to upgrade yet, unless they are looking for a new hobby.

I have a nice, stable, 18.04 system. In a few years’ time, I might consider upgrading is worth the hassle, but certainly not at the moment.

1 Like

Like the fact that there are “severe weaknesses” in it?

Yes, one that comes with a totally unreliable file manager.

What hassle is there?

The topic has digressed and the original issue has been solved. Closing.