diff options
Diffstat (limited to '.scripts/preview')
-rwxr-xr-x | .scripts/preview | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/.scripts/preview b/.scripts/preview deleted file mode 100755 index 099eb1b..0000000 --- a/.scripts/preview +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env sh - -if [ -z "$1" ]; then exit 1; fi - -basename="$(echo "$1" | sed 's/\.[^\/.]*$//')" - -wait_pdf() { - sleep 5 # Some start delay - while true; do - if ! pgrep -x "zathura" >/dev/null; then - rm -f "$basename".pdf - exit 0 - fi - done -} - -case "$1" in -*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && preview "$basename".pdf >/dev/null 2>&1 && wait_pdf & ;; -*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;; -*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;; -*) setsid -f xdg-open "$1" >/dev/null 2>&1 ;; -esac |