aboutsummaryrefslogtreecommitdiff
path: root/.scripts/preview
blob: 822e5b046496ed182bc00641c2fa7d261cfa0fd4 (plain) (blame)
1
2
3
4
5
6
7
8
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