aboutsummaryrefslogtreecommitdiff
path: root/.scripts/preview
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/preview')
-rwxr-xr-x.scripts/preview9
1 files changed, 9 insertions, 0 deletions
diff --git a/.scripts/preview b/.scripts/preview
new file mode 100755
index 0000000..822e5b0
--- /dev/null
+++ b/.scripts/preview
@@ -0,0 +1,9 @@
+#!/usr/bin/env sh
+
+basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
+
+case "$1" in
+*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;;
+*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
+*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
+esac