summaryrefslogtreecommitdiffstats
path: root/.scripts/opout
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-07-30 01:19:40 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-07-30 01:19:40 -0400
commite4a64f6527936e85541f52a34384d15f70ea9872 (patch)
tree3bfa1f3bd47f576355468f86aae87347c83327be /.scripts/opout
parent7805bedbce0cb018404d581a8b91961a26d67815 (diff)
downloadeibhear-e4a64f6527936e85541f52a34384d15f70ea9872.tar.gz
eibhear-e4a64f6527936e85541f52a34384d15f70ea9872.tar.zst
eibhear-e4a64f6527936e85541f52a34384d15f70ea9872.zip
opout script added for opening .pdfs from vim
Diffstat (limited to '.scripts/opout')
-rwxr-xr-x.scripts/opout12
1 files changed, 12 insertions, 0 deletions
diff --git a/.scripts/opout b/.scripts/opout
new file mode 100755
index 0000000..28dcafd
--- /dev/null
+++ b/.scripts/opout
@@ -0,0 +1,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