summaryrefslogtreecommitdiff
path: root/view_pdf.sh
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2020-04-13 08:40:01 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2020-04-13 08:40:01 -0700
commit96e12c8a274ea3e08648116f3fb052e3de005560 (patch)
treecc419696e4e062fc7173876073598c98cae0aa63 /view_pdf.sh
parent229b0f318e0160013c9c5700a22cc13da37fdcd8 (diff)
Initial code release
Diffstat (limited to 'view_pdf.sh')
-rwxr-xr-xview_pdf.sh12
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback