Linux 禁用和启用触摸板

来源:互联网 发布:最终幻想13 pc 优化 编辑:程序博客网 时间:2024/05/21 10:57
sudo yum -y install xorg-x11-appsxinput listxinput list-props "SynPS/2 Synaptics TouchPad" //引号中的名字因设备而异#禁用xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0#恢复xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1

每次禁用或者启用都敲一堆命令着实不方便,所以将它写成一个可执行脚本,如下:
#!/bin/sh# testcase $1 in    0)        xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0        ;;    1)        xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1        ;;esac
最后 chmod +x enable_touchpad.sh禁用触摸板:./enable_touchpad.sh 0回复触摸板:./enable_touchpad.sh 1