voidrice/.scripts/opout
2018-09-16 20:22:43 -04:00

12 lines
334 B
Bash
Executable file

#!/bin/bash
# opout: "open output": A general handler for opening a file's intended output.
# I find this useful especially running from vim.
filename=$(readlink -f "$1")
ext="${filename##*.}"
filename="${filename%.*}"
case "$ext" in
tex|md|rmd) zathura $filename.pdf & ;;
html) $TRUEBROWSER --new-window $filename.html & ;;
esac