该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#!/bin/bash
#触摸板控制脚本,开启 和 关闭
echo "============================================================="
echo "触摸板控制脚本 Written by Aknife"
echo "============================================================="
echo ""
action="";
echo "请选择您要操作的动作"
read -p "open开启触摸板,close关闭触摸板:" action
if [ "$action" != "open" ] && [ "$action" != "close" ]; then
read -p "命令不存在,请重新输入:" action
if [ "$action" != "open" ] && [ "$action" != "close" ]; then
read -p "命令不存在,请重新输入:" action
if [ "$action" != "open" ] && [ "$action" != "close" ]; then
echo "三次输入错误,程序自动退出"
exit
fi
fi
fi
if [ "$action" = "open" ]; then
echo "============================================================="
read -p "您选择了开启触摸板,按任意键执行操作:" anykey
echo ""
sudo modprobe psmouse
b=''
echo "正在启动触摸板模块。。。"
for((i=0;i<=100;i+=2)); do
printf "进度:[%-50s]%d \r" $b $i
sleep 0.1
b=#$b
done
echo ""
sleep 0.5
echo "已开启触摸板"
exit
else
echo "============================================================="
read -p "您选择了关闭触摸板,按任意键执行操作:" anykey
sudo modprobe -r psmouse
echo "已关闭触摸板"
exit
fi