Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 483  / 2 Years ago, tue, april 19, 2022, 4:03:42

I disabled the touchpad on my Dell XPS 13 to work around a bug (the mouse cursor jumps around randomly as I type, selects text, etc.), possibly in 22.04, but the OS ignores it and the touchpad remains active.enter image description here


Why, you may ask, do I think disabling the touchpad would help? Because I noticed that as long as my hands are far enough away from the touchpad, the problem doesn't occur. So before I open up the laptop and pull the plug on the touchpad, I thought I'd check in here. Has anyone else experienced this in 22.04?


More From » 22.04

 Answers
5

Find the xinput ID for the touchpad


open a terminal and use the command:


xinput list

This will output something like this:


Virtual core pointer                        id=2    [master pointer  (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SYNA30D2:00 06CB:CE08 id=10 [slave pointer (2)]
⎜ ↳ SYNA30D2:00 06CB:CE08 id=11 [slave pointer (2)]
⎜ ↳ SYNA30D2:00 06CB:CE08 id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]

For the next part, try all the ID numbers for the slave pointer to find out which is your touchpad. Mine works with id=12.


Test


Enter the command:


xinput set-prop N 'Device Enabled' 0    # Disable touchpad

Replace N with the number in id=. before entering the above command and then try the touchpad to see if it is disabled. If it does not work, use the command:


xinput set-prop N 'Device Enabled' 1    # Enable touchpad

This command will enable the device disabled by the previous command. Note which N disables the touchpad.


Script


Save the script below as /home/$USER/bin/touchtoggle.


#!/bin/bash
# Purpose: Toggles the touchpad on and off with keyboard shortcut Ctrl+Z
# set via System settings > Keyboard > keyboard Shortcuts > Custom

# Change the ID below to your touchpad ID

ID=12

TOGGLE=$HOME/.touchpadtoggle

if [ ! -e $TOGGLE ]; then
touch $TOGGLE
xinput set-prop $ID 'Device Enabled' 0 # Disable touchpad
else
rm $TOGGLE
xinput set-prop $ID 'Device Enabled' 1 # Enable touchpad
fi
exit 0

Use your file manager to set the script executable, or use the terminal and enter:


chmod +x /home/$USER/bin/touchtoggle

Check if the script works as expected by running it from the terminal by typing:


touchtoggle

Shortcut


If it works assign a keyboard shortcut like Ctrl+Z, or something similar in System settings > Keyboard > keyboard Shortcuts: View and Customize Shortcuts > Custom Shortcuts. Enter the following:



  • Name: Toggle touchpad on and off

  • Command: /home/$USER/bin/touchtoggle

  • Shotcut: Press the shortcut you want


Change $USER to your username.


Hope this helps


[#212] Wednesday, April 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
freezidepu

Total Points: 394
Total Questions: 105
Total Answers: 118

Location: Libya
Member since Mon, Dec 7, 2020
3 Years ago
freezidepu questions
Fri, Nov 11, 22, 18:04, 2 Years ago
Sat, Mar 18, 23, 10:59, 1 Year ago
;