disable touchpad through xinput

portal

New Member
Joined
Apr 16, 2019
Messages
4
Reaction score
0
Credits
0
I am trying to disable touchpad through xinput. But I cannot find the id for my touchpad... Here is xinput list:

Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ DLL07A9:01 044E:120B id=14 [slave pointer (2)]
⎜ ↳ GTech MI wireless mouse Mouse id=11 [slave pointer (2)]
⎜ ↳ GTech MI wireless mouse Consumer Control id=13 [slave pointer (2)]
⎜ ↳ DualPoint Stick id=15 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ Integrated_Webcam_HD: Integrate id=10 [slave keyboard (3)]
↳ Intel HID events id=16 [slave keyboard (3)]
↳ Intel HID 5 button array id=17 [slave keyboard (3)]
↳ Dell WMI hotkeys id=18 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=19 [slave keyboard (3)]
↳ GTech MI wireless mouse System Control id=12 [slave keyboard (3)]
↳ GTech MI wireless mouse Consumer Control id=20 [slave keyboard (3)]

I am using dell precision 3520 and running arch linux(if that is related). Can someone tell me what id corresponds to my touchpad and how you know?
 


G'day @portal and welcome to linux.org :)

DLL07A9:01 044E:120B id=14 [slave pointer (2)]

... is likely your touchpad

Code:
xinput disable 14

#and if you want it back

xinput enable 14

The codes 044E:120B are manufacturer's and device codes which are available on the internet.

So if you Google

linux 044E:120B

... you will see references to Dell.

The xinput command will only last for the session you are in, and when you reboot, you will have to repeat the process.

For a more permanent solution, we will need to edit one to two files.

Let me know if you have as part of your directory structure -

/usr/share/X11/xorg.conf.d/

and if so, its contents.

Cheers

Chris Turner
wizardfromoz
 
YES! That worked.
I do have that hierarchy. There are two files: 10-quirks.conf, 40-libinput.conf.
But why can't we just add the line "xinput disable 14" inside the .bashrc file?
And just out of curiosity, how did you decorate the code lines? I couldn't find an option to do it...
 
But why can't we just add the line "xinput disable 14" inside the .bashrc file?

You could try, and report back the outcome. However, sources I have gathered indicate mixed success. It is something like that the X environment only begins following login, and if you have a recalcitrant touchpad that affects your cursor (such as I had on my old Toshiba Satellite, but mine was with the touchscreen), it could even stop me from logging in.

Are you familiar with Nano, the CLI-based text editor?

If so,

Code:
sudo nano -m /usr/share/X11/xorg.conf.d/40-libinput.conf

The -m allows limited use of the mouse/cursor to move around more quickly, just point and click and the insertion point will move.

Possibly at or near the bottom of that file, there will be a section on touchpad, it may look a lot like this

Code:
Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Place a hash # in front of each and every one of those lines, save the changes and reboot. You can of course test with your touchpad, and if you like

Code:
xinput

and see if the ID 14 line has disappeared.

If you do find success with .bashrc or other, you are better off, instead of "xinput disable 14", you are better off using

Code:
xinput disable "DLL07A9:01 044E:120B"

... note the quotes. This will also work, but its advantage is - sometimes when we add or remove a device (perhaps a joystick, or a gaming mouse where there was no mouse previously) the IDs can get their numbers reassigned. The text description covers that.

And just out of curiosity, how did you decorate the code lines? I couldn't find an option to do it...

In your reply pane toolbar is a plus sign (+) with a squarish border. Click that and Code is one of several options.

Let us know how you go and enjoy your Linux.

Chris Turner
wizardfromoz
 
Here's a script I use with dwm to toggle the status of my touchpad.

togglepad:
Code:
#!/usr/bin/env bash

declare -i ID
ID=$( xinput list | \egrep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | \egrep -Eo '[0-9]{1,2}' )
echo "Device ID: $ID"
declare -i STATE
STATE=$( xinput list-props $ID | \grep 'Device Enabled' | \awk '{print $4}' )

echo "State: $STATE"
if [ $STATE -eq 1 ]
then
    xinput disable $ID
    echo "Touchpad disabled."
    xsetroot -name "Touchpad disabled!"
else
    xinput enable $ID
    echo "Touchpad enabled."
    xsetroot -name "Touchpad enabled!"
fi

I have that script in my personal bin directory (~/bin/) and have it bound to a keybind in dwm (my window manager of choice).

You may want to remove or comment out the lines with the xsetroot commands - I use that to set dwms status bar text to give me some visual feedback on what the script did. So you might not want that!

Also, I've put in some code to automatically detect the ID of the togglepad. I used to have the ID hard-coded, but the last time I copied my togglepad script to a new laptop, the touchpad had a different ID.
So my original script didn't work.

I ended up having to use xinput to list all inputs, find the ID for the trackpad on the new laptop and update the hard-coded device ID in my script. So rather than having to do that every time I get a new PC, I future-proofed it a bit! Totally worth it! Ha ha! XD

Either way - put that script in a directory somewhere in your $PATH, make sure it has the executable bit set in the permissions ( "chmod +x /path/to/togglepad" will do it!). Then in your chosen desktop/window managers settings - set up a keybind to run the script. Then you can toggle the trackpad using the keybind you set up.
 
Last edited:
Thank you all for your help! The codes worked. Learned a lot.
I am actually planning to switch to dwm, but right now facing some issues. I will probably post it as another thread if I really can't resolve it...
 

Members online


Latest posts

Top