红联Linux门户
Linux帮助

Linux禁用和启用触摸板

发布时间:2014-11-20 22:12:27来源:linux网站作者:qiaoning13256

Linux禁用和启用触摸板:

sudo yum -y install xorg-x11-apps 
xinput list 
xinput 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  
# test  
case $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