Skip to main content

Disable touchpad - ID keeps changing [Resolved]

What I have so far:

output=$( xinput)

output2=$"$output" | sed 's/.* touchpad \(.*\) [ .*/\1/'

My laptop touchpad sucks and I want to just use the center mouse control stick and buttons. This is easy in Windows, but in Lubuntu, it can apparently only be done with commands. It would be easier if xinput always yielded the same ID numbers, but they seem to change after reboot. My xinput reads:

? Virtual core pointer                      id=2    [master pointer  (3)]
?   ? Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
?   ? AlpsPS/2 ALPS DualPoint TouchPad          id=13   [slave  pointer  (2)]
?   ? AlpsPS/2 ALPS DualPoint Stick             id=14   [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)]
    ? Laptop_Integrated_Webcam_3M: In           id=10   [slave  keyboard (3)]
    ? Dell WMI hotkeys                          id=11   [slave  keyboard (3)]
    ? AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]

What to do to get "13" into a variable so I can use it to disable the item?

Question Credit: primuspaul
Question Reference
Asked October 10, 2018
Posted Under: Unix Linux
1 Answers

You can use something like this to get the id:

output=$(xinput --list |
 sed -n '/AlpsPS.2 ALPS DualPoint TouchPad/s/.*id=\([0-9]*\).*/\1/p')

but in fact you don't need to, as you can specify the device to disable by name:

xinput --disable  'AlpsPS/2 ALPS DualPoint TouchPad'

credit: meuh
Answered October 10, 2018
Your Answer