#!/bin/bash
#This is a vgaoff & touchpadoff
#By spinestars
#-2-18
#TouchPad & VGA OFF if [ $ == ];then
echo "OFF" >> /sys/kernel/debug/vgaswitcheroo/switch
cat /sys/kernel/debug/vgaswitcheroo/switch > ./vga.tmp
awk 'BEGIN{OF=":"}/DIS:.:Off/{print "VGA is OFF!"}' vga.tmp
rm -rf vga.tmp
synclient TouchpadOFF= > /dev/null >& &&
synclient | grep "TouchpadOff" | awk '/.*= 1/{print "TouchPad is OFF!"}' ||
gconftool- --set --type boolean /desktop/gnome/peripherals/touchpad/touchpad_enabled false ||
rmmod psmouse
[ $?== ] && echo 'TouchPad is OFF!'
fi
#TouchPad ON
if [ $ == ];then
synclient TouchpadOFF= > /dev/null >& &&
synclient | grep "TouchpadOn" | awk '/.*= 1/{print "TouchPad is ON!"}' ||
gconftool- --set --type boolean /desktop/gnome/peripherals/touchpad/touchpad_enabled ture ||
modprobe psmouse
[ $?== ] && echo 'TouchPad is ON!'
fi
昨天装了deepin,结果昨天还能用synclient关闭触摸板,今天就不行了。。。于是网上有找了其他2种方法,故而就将三种方法合并到了一起。
参数1是开启,参数0是关闭(关闭的时候会顺便将ATI显卡的独显给关掉,开启的时候则不再开启独显)。
zyh@deepin:~/桌面$ sudo ./vga_touchpadoff.sh
VGA is OFF!
TouchPad is OFF!
TouchPad is OFF!
zyh@deepin:~/桌面$ sudo ./vga_touchpadoff.sh
TouchPad is ON!