Ubuntu 18.04 disable/enable the touchpad via commands

Under Ubuntu, I often encounter situations where I can’t turn off the touchpad with a shortcut key. This problem occurred after installing Ubuntu 18.04 on the blogger’s computer.

Solution:

First check

Under Ubuntu, I often encounter situations where I can’t turn off the touchpad with a shortcut key. This problem occurred after installing Ubuntu 18.04 on the blogger’s computer.

Solution:

First check the id of the input device, the command line input: xinput, as shown in the figure, the id of the blogger’s TouchPad is 17, and the id is different for different computers.

After knowing id=17, you can turn off/on the touchpad through commands,

Close command: xinput --disable 17

Enable command: xinput --enable 17

It’s too troublesome to input this way each time. Simplify it. Write 2 shell files, one to turn off the TouchPad, named off17, and one to turn on the TouchPad, named on17.

Then put these two files into modification permissions, and then move them to the /usr/bin/ directory,

Command line input: chmod a+x off17

sudo mv off17 /usr/bin/

So you can enter off17 on the command line to turn off the touchpad,

same,

Command line input: chmod a+x on17

sudo mv on17 /usr/bin/

You can turn on the touchpad by typing on17.

Enter the id of the device and enter the command line: xinput, as shown in the figure, the id of the blogger’s TouchPad is 17, and the id is different for different computers.

After knowing id=17, you can turn off/on the touchpad through commands,

Close command: xinput --disable 17

Enable command: xinput --enable 17

It’s too troublesome to input this way each time. Simplify it. Write 2 shell files, one to turn off the TouchPad, named off17, and one to turn on the TouchPad, named on17.

Then put these two files into modification permissions, and then move them to the /usr/bin/ directory,

Command line input: chmod a+x off17

sudo mv off17 /usr/bin/

So you can enter off17 on the command line to turn off the touchpad,

same,

Command line input: chmod a+x on17

sudo mv on17 /usr/bin/

You can turn on the touchpad by typing on17.

to sum up

The above is the Ubuntu 18.04 introduced to you by the editor to disable/enable the touchpad through commands. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Posts

Ubuntu 18.04 disable/enable the touchpad via commands
Ubuntu common commands
Ubuntu configure network commands
Ubuntu install the latest Python 3.
ubuntu unzip the rar file
ubuntu1804 build the latest Suricata