summaryrefslogtreecommitdiffstats
path: root/.scripts/opout
blob: 91323a574d2987ac009b7bd607627f4f012eb705 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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) setsid zathura "$filename".pdf & ;;
	html) setsid $TRUEBROWSER --new-window "$filename".html & ;;
	sent) setsid sent "$1" & ;;
esac