voidrice/.local/bin/opout

15 lines
517 B
Text
Raw Normal View History

#!/bin/sh
2019-05-29 16:33:49 +00:00
# opout: "open output": A general handler for opening a file's intended output,
# usually the pdf of a compiled document. I find this useful especially
# running from vim.
2019-01-08 18:52:05 +00:00
basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
2018-10-04 18:00:58 +00:00
case "$1" in
2020-01-20 00:26:28 +00:00
*.tex|*.md|*.[rR]md|*.ms|*.me|*.mom) setsid "$READER" "$basename".pdf >/dev/null 2>&1 & ;;
2019-05-29 16:33:49 +00:00
*.[0-9]) setsid "$READER" "$basename".pdf >/dev/null 2>&1 & ;;
*.html) setsid $BROWSER "$basename".html >/dev/null 2>&1 & ;;
2018-11-01 01:54:30 +00:00
*.sent) setsid sent "$1" >/dev/null 2>&1 & ;;
esac