run: use installed default fonts

This commit is contained in:
2026-08-14 02:10:45 +09:00
parent 6c0a533c4e
commit 05ff88c74f
2 changed files with 22 additions and 0 deletions

View File

@@ -116,6 +116,9 @@ scalable outline files may be supplied; their argument order is the glyph
fallback order. A collection file uses its first face. If any named file is fallback order. A collection file uses its first face. If any named file is
absent or invalid, the popup disables itself cleanly while input processing absent or invalid, the popup disables itself cleanly while input processing
continues. `run.sh` and `bench.sh` accept the same font-file arguments. continues. `run.sh` and `bench.sh` accept the same font-file arguments.
When `run.sh` is invoked without arguments, it uses the installed DejaVu,
Jigmo, or Noto CJK font files from the standard Arch Linux paths. Explicit
font-file arguments replace these defaults.
The IPC socket is placed at `$XDG_RUNTIME_DIR/strans.sock` when 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 `XDG_RUNTIME_DIR` is an absolute path. Otherwise strans uses the per-user

19
run.sh
View File

@@ -1,6 +1,25 @@
#!/bin/sh #!/bin/sh
cd "$(dirname "$0")" cd "$(dirname "$0")"
if test "$#" -eq 0; then
set --
for font in \
/usr/share/fonts/TTF/DejaVuSans.ttf \
/usr/share/fonts/TTF/Jigmo.ttf \
/usr/share/fonts/TTF/Jigmo2.ttf \
/usr/share/fonts/noto/NotoSansCJK-Regular.ttc
do
if test -f "$font"; then
set -- "$@" "$font"
fi
done
if test "$#" -eq 0; then
echo "run.sh: no default font found; pass a font file" >&2
exit 1
fi
fi
pkill strans pkill strans
sleep 1 sleep 1
./strans map "$@" & ./strans map "$@" &