1.需要的命令
禁用触摸板用:sudo rmmod psmouse 或是 sudo modprobe -r psmouse
启用触摸板用:sudo modprobe psmouse
2.编写sh脚本文件
开启脚本文件:KQCMB.sh
!#/bin/sh
#开启触摸板
sudo modprobe psmouse
echo "OPEND"
关闭脚本文件:JYCMB.sh
!#/bin/sh
#禁用触摸板
sudo modprobe -r psmouse
echo "CLOSED"
3.进入终端,使脚本变为可执行
用命令:chmod +x 脚本文件全名
root@Peer-PC:/MyData# chmod +x KQCMB.sh
root@Peer-PC:/MyData# chmod +x JYCMB.sh
4.执行脚本
在终端中输入: ./脚本文件全名
root@Peer-PC:/MyData# ls
JYCMB.sh JYCMB.sh~ KQCMB.sh KQCMB.sh~ lost+found
root@Peer-PC:/MyData# ./KQCMB.sh
./KQCMB.sh: line 1: !#/bin/sh: 没有那个文件或目录
WARNING: All config files need .conf: /etc/modprobe.d/alsa-base, it will be ignored in a future release.
OPEND
root@Peer-PC:/MyData# ./JYCMB.sh
./JYCMB.sh: line 1: !#/bin/sh: 没有那个文件或目录
WARNING: All config files need .conf: /etc/modprobe.d/alsa-base, it will be ignored in a future release.
CLOSED
root@Peer-PC:/MyData