aboutsummaryrefslogtreecommitdiff
path: root/.scripts/preview
diff options
context:
space:
mode:
authorMarvin Borner2020-06-11 14:53:23 +0200
committerMarvin Borner2020-06-11 14:53:23 +0200
commitcfc61f4fa5a5b2236439ec1ebe416f23e31d8092 (patch)
tree96f4fd5f4d57e6835dd6f105caca30c65d7160e5 /.scripts/preview
parentd05b17617eb83377f980c24f29079229697504cc (diff)
Soo many features added
weeee so much efficiencyyyy
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