typstwatch: don't open half written files

This commit is contained in:
LordMZTE 2024-11-05 08:07:36 +01:00
parent 7ab1832bd8
commit a20c3ea6bf
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -4,6 +4,8 @@ trap 'kill $(jobs -p); rm "$tmpf"' EXIT
typst watch "$1" "$tmpf" "${@:2}" & typst watch "$1" "$tmpf" "${@:2}" &
while [ ! -f "$tmpf" ]; do sleep 1; done # Without this, zathura may try to open a half-written file. This is a hack, but I don't know of a
# better approach.
sleep 1
zathura "$tmpf" zathura "$tmpf"