summaryrefslogtreecommitdiffstats
path: root/.scripts/opout
blob: 28dcafd690ff803f9a2dd676900ca80d2ef8dd9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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) $BROWSER --new-window $filename.html & ;;
esac