#!/bin/bash
touchchar=`xinput list |grep -i touchpad|cut -d '=' -f2`
devid=${touchchar:0:2}
var=$(xinput list-props $devid | grep "Device Enabled")
if [ ${var:((${#var}-1))} == "1" ];then
xinput set-prop $newid "Device Enabled" 0
elif [ ${var:((${#var}-1))} == "0" ];then
xinput set-prop $newid "Device Enabled" 1
fi
将脚本保存为/usr/bin/touchpad.sh,然后绑定一个快捷键,比如我把这个脚本绑定到F7,然后就可以用F7来切换触控板启用状态了。