run: return after background startup

This commit is contained in:
2026-08-14 04:19:12 +09:00
parent 24e380651c
commit c2cb18cbdd
2 changed files with 28 additions and 303 deletions

View File

@@ -125,16 +125,18 @@ font-file arguments replace these defaults:
./run.sh /path/to/primary.ttf /path/to/fallback.ttc
```
`run.sh` remains in the foreground and owns only the daemon and XIM process
that it starts. It waits for that daemon's IPC socket and IBus address file
before reporting success. With `DISPLAY` set it then starts XIM; without a
display it keeps the headless daemon in the foreground and does not start
XIM. A signal or XIM exit stops and reaps the launcher's daemon. On repeated
invocation, it stops a previous live `run.sh` only after confirming that the
old launcher directly owns the daemon serving the same IPC and IBus
endpoints and that the daemon carries that launcher's PID and process-start
identity. A manually started or orphaned daemon is left untouched and
reported as a visible startup failure.
`run.sh` uses `pkill` to stop this user's existing `strans` and `strans-xim`
processes, starts fresh ones in the background, and returns. Run the same
command again to restart them. Without `DISPLAY`, it starts only the daemon.
An X startup hook can invoke it directly before starting the desktop session:
```sh
/path/to/strans/run.sh
exec /bin/sh /etc/xdg/xfce4/xinitrc "$@"
```
The launcher targets Linux and requires `pkill` from procps-ng.
The IPC socket is placed at `$XDG_RUNTIME_DIR/strans.sock` when
`XDG_RUNTIME_DIR` is an absolute path. Otherwise strans uses the per-user