From 01d73eb2abf9938b401c1cb8750f901f72d5b25a Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Thu, 19 Jan 2023 12:56:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0installsh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 7 ++++++- run_daemon.sh | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 9b77f8c..d8888e1 100644 --- a/install.sh +++ b/install.sh @@ -3,5 +3,10 @@ find . -name '*.deb' | xargs sudo dpkg -i sudo apt-mark hold lxc lxc-templates liblxc1 liblxc-common lxc-utils sudo apt install -f -y sudo apt install libdframeworkdbus2 screen libnotify-bin -y - +which uengine +if [[ $? != 0 ]]; then + echo UEngine 安装失败! + sudo rm -v /usr/bin/uengine-loading-ubuntu + exit +fi echo "请重启并换成5.17内核,然后运行launch_uengine.sh即可启动" diff --git a/run_daemon.sh b/run_daemon.sh index 080bd4b..e3f6d66 100755 --- a/run_daemon.sh +++ b/run_daemon.sh @@ -14,9 +14,20 @@ unset WAYLAND_DISPLAYCOPY XDG_CURRENT_DESKTOP="Deepin" export LD_LIBRARY_PATH=/usr/share/uengine/lib64/ # 判断 UEngine 是否被正确安装 +which uengine +if [[ $? != 0 ]]; then + notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "未安装 UEngine,结束!" -a uengine-runner + exit +fi notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务启动完成" -a uengine-runner # 守护进程,防止异常退出 while [[ true ]]; do uengine session-manager -platformtheme=deepin + # 让用户可以强制结束 + if [[ -f "/tmp/uengine-loading-ubuntu-end" ]]; then + rm /tmp/uengine-loading-ubuntu-end + notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常崩溃,不再重启服务" -a uengine-runner + break + fi notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常结束,重新启动" -a uengine-runner done \ No newline at end of file