mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
22 lines
597 B
Bash
Executable File
22 lines
597 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# 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.
|
|
|
|
silent_open() {
|
|
setsid -f "${@}" > /dev/null 2>&1
|
|
}
|
|
|
|
case "${1}" in
|
|
*.tex | *.sil | *.m[dse] | *.[rR]md | *.mom | *.[0-9])
|
|
silent_open xdg-open "$(getcomproot "${1}" || echo "${1%.*}").pdf"
|
|
;;
|
|
*.html)
|
|
silent_open "${BROWSER}" "${1%.*}.html"
|
|
;;
|
|
*.sent)
|
|
silent_open sent "${1}"
|
|
;;
|
|
esac
|