`
cloudtech
  • 浏览: 4612712 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

Ubuntu下编写脚本开启和关闭触摸板

 
阅读更多
1.需要的命令

禁用触摸板用:sudo rmmod psmouse 或是 sudo modprobe -r psmouse
 启用触摸板用:sudo modprobe psmouse

2.编写sh脚本文件

开启脚本文件:KQCMB.sh

对linux不熟悉的只需打开终端 vi 文件名.sh 即可 进入编辑界面 键盘输入i 即可开始编写 之后 esc wq 保存

!#/bin/sh
#开启触摸板
sudo modprobe psmouse
echo "OPEND"

关闭脚本文件:JYCMB.sh

!#/bin/sh
#禁用触摸板
sudo modprobe -r psmouse
echo "CLOSED"

3.进入终端,使脚本变为可执行

用命令:chmod +x 脚本文件全名

lion@Lion-os:# chmod +x KQCMB.sh
lion@Lion-os:# chmod +x JYCMB.sh
4.执行脚本

在终端中输入: ./脚本文件全名 ./运行的意思


lion@Lion-os:# ./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
lion@Lion-os:# ./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


禁用触摸板用:sudo rmmod psmouse 或是 sudo modprobe -r psmouse
 启用触摸板用:sudo modprobe psmouse

2.编写sh脚本文件

开启脚本文件:KQCMB.sh

对linux不熟悉的只需打开终端 vi 文件名.sh 即可 进入编辑界面 键盘输入i 即可开始编写 之后 esc wq 保存

!#/bin/sh
#开启触摸板
sudo modprobe psmouse
echo "OPEND"

关闭脚本文件:JYCMB.sh

!#/bin/sh
#禁用触摸板
sudo modprobe -r psmouse
echo "CLOSED"

3.进入终端,使脚本变为可执行

用命令:chmod +x 脚本文件全名

lion@Lion-os:# chmod +x KQCMB.sh
lion@Lion-os:# chmod +x JYCMB.sh
4.执行脚本

在终端中输入: ./脚本文件全名 ./运行的意思


lion@Lion-os:# ./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
lion@Lion-os:# ./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


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics