Linux 禁用和启用触摸板

字体大小: 中小 标准 ->行高大小: 标准

Linux 禁用和启用触摸板:

    sudo yum -y install xorg-x11-apps  
  1. xinput list  
  2. xinput list-props "SynPS/2 Synaptics TouchPad" //引号中的名字因设备而异  
  3.   
  4. #禁用  
  5. xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0  
  6.   
  7. #恢复  
  8. xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1  

每次禁用或者启用都敲一堆命令着实不方便,所以将它写成一个可执行脚本,如下:

  1. #!/bin/sh   
  2. # test   
  3. case $1 in  
  4.     0)  
  5.         xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0  
  6.         ;;  
  7.     1)  
  8.         xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1  
  9.         ;;  
  10. esac  

最后 chmod +x enable_touchpad.sh 

禁用触摸板:./enable_touchpad.sh 0 

回复触摸板:./enable_touchpad.sh 1 

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/57477.html