Ubuntu 18.04 disable/enable touchpad via command

Ubuntu 18.04 disable/enable touchpad via command

In Ubuntu, you often encounter the situation where you cannot turn off the touchpad with shortcut keys. This problem occurred after the blogger installed Ubuntu 18.04 on his computer.

Solution:

View First

In Ubuntu, you often encounter the situation where you cannot turn off the touchpad with shortcut keys. This problem occurred after the blogger installed Ubuntu 18.04 on his computer.

Solution:

First check the id of the input device. Enter the command line: xinput. As shown in the figure, the id of the blogger's TouchPad is 17. The ids of different computers are different.

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

Disable command: xinput --disable 17

Enable command: xinput --enable 17

It is too troublesome to enter it like this every time, so let's simplify it and write two shell files, one to turn off the TouchPad, named off17, and the other to turn on the TouchPad, named on17.

Then add the modification permissions to these two files and move them to the /usr/bin/ directory.

Command line input: chmod a+x off17

sudo mv off17 /usr/bin/

In this way, you can enter off17 in 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 entering on17.

Enter the device ID, enter the command line: xinput , as shown in the figure, the blogger's TouchPad ID = 17, different computers have different IDs,

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

Disable command: xinput --disable 17

Enable command: xinput --enable 17

It is too troublesome to enter it like this every time, so let's simplify it and write two shell files, one to turn off the TouchPad, named off17, and the other to turn on the TouchPad, named on17.

Then add the modification permissions to these two files and move them to the /usr/bin/ directory.

Command line input: chmod a+x off17

sudo mv off17 /usr/bin/

In this way, you can enter off17 in 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 entering on17.

Summarize

The above is what I introduced to you about disabling/enabling the touchpad in Ubuntu 18.04 through commands. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Installation and usage instructions of rz/sz command under Ubuntu
  • Analysis of Ubuntu tab key can not automatically complete the command parameters
  • How to run the deb installation package using the dpkg command line in Ubuntu
  • ubuntu (linux) modify network card name command

<<:  Steps to create a WEBSERVER using NODE.JS

>>:  MySQL 8.0.15 installation and configuration method graphic tutorial under win10 home version 64

Recommend

Vue's Render function

Table of contents 1. Nodes, trees, and virtual DO...

Docker installation of MySQL (8 and 5.7)

This article will introduce how to use Docker to ...

An article to understand the usage of typeof in js

Table of contents Base Return Type String and Boo...

JavaScript anti-shake and throttling detailed explanation

Table of contents Debounce Throttle Summarize Deb...

Detailed explanation of Docker common commands Study03

Table of contents 1. Help Command 2. Mirror comma...

Using CSS to implement image frame animation and curve motion

The basic principle of all animations is to displ...

HTML structured implementation method

DIV+css structure Are you learning CSS layout? Sti...

Analysis of the process of deploying Python applications in Docker containers

Simple application deployment 1. Directory struct...

Detailed explanation of JDBC database link and related method encapsulation

Detailed explanation of JDBC database link and re...

Neon light effects implemented with pure CSS3

This is the effect to be achieved: You can see th...

CSS3 realizes bouncing ball animation

I usually like to visit the special pages or prod...

HTML+CSS merge table border sample code

When we add borders to table and td tags, double ...

How to implement n-grid layout in CSS

Common application scenarios The interfaces of cu...

Install Centos7 using Hyper-v virtual machine

Table of contents introduce Prepare Download syst...