Files
strans/run.sh

36 lines
532 B
Bash
Executable File

#!/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=$!
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