#!/bin/bash
user=$(whoami)
wechat1="/home/${USER}/桌面/wechat.desktop"
wechat2="/usr/share/applications/wechat.desktop"
# 用户输入密码
echo -e "请输入当前系统解锁密码,输入完成请回车"
read passwd
if [[ -e ${wechat1} -o -e ${wechat2} ]];then
echo "${passwd}" | sudo -S sed -i "s#Exec=.*#Exec=wechat %U --disable-gpu#" ${wechat1} ${wechat2}
if [[ $? -eq "0" ]];then
echo "已完成修复,请重新打开微信测试是否解决卡顿问题。3s后自动退出"
else
echo "貌似密码输入错误,请重新执行"
fi
sleep 3
else
echo "不存在微信快捷方式,请检查是否安装微信。3S后自动退出"
sleep 3
fi
本文来自博客园,作者:坐公交也用券,转载请注明原文链接:https://www.cnblogs.com/liumou-site/p/17105888.html