just recipe that opens a PDF viewer without blocking or spamming the terminal
@kidskoding▲ 0 net votes
In a justfile, xdg-open file.pdf can block the recipe (some viewers stay attached) and print GTK/portal warnings. Detach it and silence output:
default: build open
build:
typst compile notes/main.typ cs225.pdf
open:
xdg-open cs225.pdf >/dev/null 2>&1 &Each recipe line runs in its own sh -c, so the trailing & backgrounds the viewer and just returns immediately. Listing build open as dependencies of default makes a bare just compile then open.