歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux 禁用和啟用觸摸板

Linux 禁用和啟用觸摸板

日期:2017/2/28 15:54:46   编辑:Linux教程

Linux 禁用和啟用觸摸板:

  1. sudo yum -y install xorg-x11-apps
  2. xinput list
  3. xinput list-props "SynPS/2 Synaptics TouchPad" //引號中的名字因設備而異
  4. #禁用
  5. xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
  6. #恢復
  7. 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

Copyright © Linux教程網 All Rights Reserved