Ubuntu 18.04 disable / enable touchpad via command

Time:2021-2-25

Under Ubuntu, it is often impossible to close the touchpad with shortcut keys. This problem occurs after the blogger’s computer has installed Ubuntu 18.04.

terms of settlement:

Check it out first

Under Ubuntu, it is often impossible to close the touchpad with shortcut keys. This problem occurs after the blogger’s computer has installed Ubuntu 18.04.

terms of settlement:

First of all, check the ID of the input device. Command line input: XInput, as shown in the figure, the ID of the blogger’s touchpad is 17. Different computers have different IDs,

When you know id = 17, you can turn off / on the touchpad through the command,

Close command:xinput --disable 17

Open command:xinput --enable 17

It’s too cumbersome to input in this way every time. To simplify it, write two shell files, one for closing touchpad, named off17, and one for opening touchpad, named on17,

Then put these two files in the modify permission, and move them to the / usr / bin / directory,

Command line input:chmod a+x off17

sudo mv off17 /usr/bin/

So you can close the touchpad by typing off17 on the command line,

Again,

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, command line input: XInput, as shown in the figure, the ID of the blogger’s touchpad is 17, and different computers have different IDs,

When you know id = 17, you can turn off / on the touchpad through the command,

Close command:xinput --disable 17

Open command:xinput --enable 17

It’s too cumbersome to input in this way every time. To simplify it, write two shell files, one for closing touchpad, named off17, and one for opening touchpad, named on17,

Then put these two files in the modify permission, and move them to the / usr / bin / directory,

Command line input:chmod a+x off17

sudo mv off17 /usr/bin/

So you can close the touchpad by typing off17 on the command line,

Again,

Command line input:chmod a+x on17

sudo mv on17 /usr/bin/

You can turn on the touchpad by typing on17.

summary

The above is the introduction of Ubuntu 18.04 by Xiaobian. I hope it can help you. If you have any questions, please leave me a message and Xiaobian will reply you in time. Thank you very much for your support to developer!
If you think this article is helpful to you, please reprint, please indicate the source, thank you!

Recommended Today

Rest command line tool demo

https://www.bilibili.com/vide… In this tutorial, we’ll show you how to use therestyCommand line tools. cd ~ export PATH=/usr/local/openresty/bin:$PATH which resty It’s usually this path. We can go through it-VOption to check its version number. resty -V If you use usPre built Linux binary packageInstall openresty, then you should install itopenresty-restyBag. dnf list installed openresty-resty Because it’s […]