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

MySQL uses the truncate command to quickly clear all tables in a database

1. Execute the select statement first to generate...

WeChat applet custom tabBar step record

Table of contents 1. Introduction 2. Customize ta...

Detailed introduction and usage examples of map tag parameters

Map tags must appear in pairs, i.e. <map> .....

How to use Docker to build a pypi private repository

1. Construction 1. Prepare htpasswd.txt file The ...

Solution to the welcome to emergency mode message when booting CentOS7.4

Today I used a virtual machine to do an experimen...

Detailed explanation of Linux mpstat command usage

1. mpstat command 1.1 Command Format mpstat [ -A ...

How to build DockerHub yourself

The Docker Hub we used earlier is provided by Doc...

CSS naming conventions (rules) worth collecting Commonly used CSS naming rules

CSS naming conventions (rules) Commonly used CSS ...

Solution for forgetting the root password of MySQL5.7 under Windows 8.1

【background】 I encountered a very embarrassing th...

Solution for Nginx installation without generating sbin directory

Error description: 1. After installing Nginx (1.1...

Vue integrates PDF.js to implement PDF preview and add watermark steps

Table of contents Achieve results Available plugi...

js realizes the function of clicking to switch cards

This article example shares the specific code of ...

Three properties of javascript objects

Table of contents 1. writable: writable 2. enumer...

Steps to introduce PWA into Vue project

Table of contents 1. Install dependencies 2. Conf...