summaryrefslogtreecommitdiff
path: root/view_pdf.sh
blob: ee9458cac7d2c61a60376a3a8ff74d8a9a2fc887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
filename="$(find . -name '*.pdf')"
if type xdg-open > /dev/null 2>&1; then
    # X11-based systems (Linux, BSD).
    exec xdg-open "${filename}" &
elif type open > /dev/null 2>&1; then
    # macOS.
    exec open "${filename}"
else
    echo "Don't know how to view PDFs on this platform." >&2
    exit 1
fi
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback