diff --git a/.godot.pid b/.godot.pid index 6cd0116..b46eac0 100644 --- a/.godot.pid +++ b/.godot.pid @@ -1 +1 @@ -3290165 +4016409 diff --git a/.tray.pid b/.tray.pid index fed41f1..ced2ff7 100644 --- a/.tray.pid +++ b/.tray.pid @@ -1 +1 @@ -3290166 +4016410 diff --git a/run b/run index 317775b..774b2d1 100755 --- a/run +++ b/run @@ -154,10 +154,17 @@ cmd_stop() { tray_pid=$(cat "$TRAY_PIDFILE" 2>/dev/null) if [ -n "$tray_pid" ] && kill -0 "$tray_pid" 2>/dev/null; then kill "$tray_pid" 2>/dev/null && echo "Stopped tray (pid $tray_pid)" || true + # Wait for GTK cleanup (status notifier deregistration) — up to 3s + local waited=0 + while kill -0 "$tray_pid" 2>/dev/null && [ "$waited" -lt 30 ]; do + sleep 0.1 + waited=$((waited + 1)) + done + kill -0 "$tray_pid" 2>/dev/null && { kill -9 "$tray_pid" 2>/dev/null || true; } fi rm -f "$TRAY_PIDFILE" fi - pgrep -f "chobit_tray\\.py" | while read -r cpid; do + pgrep -f "(chobit_tray|dev_trays)\\.py" | while read -r cpid; do kill "$cpid" 2>/dev/null done || true