diff options
author | Matthew Sotoudeh <matthewsot@outlook.com> | 2020-04-13 08:40:01 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthewsot@outlook.com> | 2020-04-13 08:40:01 -0700 |
commit | 96e12c8a274ea3e08648116f3fb052e3de005560 (patch) | |
tree | cc419696e4e062fc7173876073598c98cae0aa63 /view_pdf.sh | |
parent | 229b0f318e0160013c9c5700a22cc13da37fdcd8 (diff) |
Initial code release
Diffstat (limited to 'view_pdf.sh')
-rwxr-xr-x | view_pdf.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/view_pdf.sh b/view_pdf.sh new file mode 100755 index 0000000..ee9458c --- /dev/null +++ b/view_pdf.sh @@ -0,0 +1,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 |