cang-ying/scripts/eed-tauri.sh
Zhuyuan Operations ce32073d07 D205 面板功能大升级+本地漫剧管线+经验自动机制+飞书资料归档
- 面板: 会话持久化(oc_sess.json)/余额实时/文件栏(搜索+MD+拖拽)/朗读(edge-tts)/工具过程实时显示/漫剧画布
- 面板: 经验自动检索注入+存经验按钮(experience.py)
- 管线: local_motion本地运镜/IMAGE-FIRST-GUIDE/LOCAL-PIPELINE-V1
- 经验: EED-EXPER-014 面板工程+管线+飞书扒取全记录
- 资料: 飞书《清欢AIGC伪真人短剧全流程》归档
2026-08-03 22:55:02 +08:00

34 lines
1.3 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# eed-tauri.sh — 苍耳面板·Tauri 真桌面壳启动器
#
# 修复"点图标唤不醒"
# 根因1 壳关窗=隐藏到托盘且无单实例保护 → 进程越堆越多,新窗口不前台
# 根因2 旧版脚本会无脑重启面板 → 打断正在跑的对话
# 现在的策略:
# ① 只留一个壳(先杀干净旧壳,含 WebKit 子进程)
# ② 面板健康就不动它(不打断正在跑的任务),只有挂了才重启
# ③ 等面板真的能连上再开窗,避免白屏
# 注意pkill -x 精确匹配进程名,避免误杀脚本自身(曾踩坑)
URL="http://127.0.0.1:8765"
# ① 清掉旧壳(隐藏在托盘里的那些"看不见的实例"
pkill -x eed-desktop 2>/dev/null
sleep 1
pkill -9 -x eed-desktop 2>/dev/null
# ② 面板健康检查:能连上就复用,不重启(保住正在跑的对话)
if curl -s --max-time 2 "$URL" >/dev/null 2>&1; then
echo "🟢 面板已在运行,直接开窗(不打断当前对话)"
else
echo "🟡 面板未运行,正在拉起…"
bash /home/ls/cang-ying/scripts/restart-eed.sh >/dev/null 2>&1 &
for _ in $(seq 1 20); do
curl -s --max-time 2 "$URL" >/dev/null 2>&1 && break
sleep 1
done
fi
# ③ 开窗
exec /home/ls/cang-ying/bin/eed-desktop