build: restore the single-instance launcher

This commit is contained in:
2026-08-12 18:32:18 +09:00
parent 9051c69b49
commit e69883d0ad

33
run.sh
View File

@@ -1,35 +1,8 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")"
strans_pid=
xim_pid=
cleanup()
{
trap - 0 1 2 15
if test -n "$xim_pid"; then
kill "$xim_pid" 2>/dev/null || true
wait "$xim_pid" 2>/dev/null || true
fi
if test -n "$strans_pid"; then
kill "$strans_pid" 2>/dev/null || true
wait "$strans_pid" 2>/dev/null || true
fi
}
trap cleanup 0 1 2 15
./strans map font &
strans_pid=$!
pkill strans
sleep 1
./strans map font &
sleep 1
kill -0 "$strans_pid"
xim/strans-xim &
xim_pid=$!
while kill -0 "$strans_pid" 2>/dev/null && kill -0 "$xim_pid" 2>/dev/null; do
sleep 1
done