diff --git a/.local/bin/compile b/.local/bin/compile new file mode 100755 index 0000000..f7b4ae4 --- /dev/null +++ b/.local/bin/compile @@ -0,0 +1,39 @@ +#!/usr/bin/env sh + +# from https://github.com/LukeSmithxyz/voidrice/blob/master/.local/bin/compiler +# +# This script will compile or run another finishing operation on a document. I +# have this script run via vim. +# +# Compiles .tex. groff (.mom, .ms), .rmd, .md. Opens .sent files as sent +# presentations. Runs scripts based on extention or shebang + +file=$(readlink -f "$1") +dir=$(dirname "$file") +base="${file%.*}" + +cd "$dir" || exit + +textype() { + command="pdflatex" + (sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex" + $command --output-directory="$dir" "$base" && + grep -i addbibresource "$file" >/dev/null && + biber --input-directory "$dir" "$base" && + $command --output-directory="$dir" "$base" && + $command --output-directory="$dir" "$base" +} + +case "$file" in +*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf >"$base".pdf ;; +*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf >"$base".pdf ;; +*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf >"$base".pdf ;; +*\.rmd | *\.md | *\.mkd | *\.markdown) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; +*\.tex) textype "$file" ;; +*config.h) sudo make install ;; +*\.c) cc "$file" -o "$base" && "$base" ;; +*\.py) python "$file" ;; +*\.go) go run "$file" ;; +*\.sent) setsid sent "$file" 2>/dev/null &;; +*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; +esac diff --git a/.local/bin/open-compiled b/.local/bin/open-compiled new file mode 100755 index 0000000..1beff67 --- /dev/null +++ b/.local/bin/open-compiled @@ -0,0 +1,15 @@ +#!/usr/bin/env 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. +# +# from https://github.com/LukeSmithxyz/voidrice/tree/master/.local/bin + +basename="$(echo "$1" | sed 's/\.[^\/.]*$//')" + +case "$1" in + *.tex|*.md|*.rmd|*.ms|*.me|*.mom) setsid "$FILEREADER" "$basename".pdf >/dev/null 2>&1 & ;; + *.[0-9]) setsid "$FILEREADER" "$basename".pdf >/dev/null 2>&1 & ;; + *.html) setsid "$BROWSER" "$basename".html >/dev/null 2>&1 & ;; +esac diff --git a/.local/bin/rofi-bang b/.local/bin/rofi/rofi-bang similarity index 100% rename from .local/bin/rofi-bang rename to .local/bin/rofi/rofi-bang diff --git a/.local/bin/rofi-gopass b/.local/bin/rofi/rofi-gopass similarity index 100% rename from .local/bin/rofi-gopass rename to .local/bin/rofi/rofi-gopass diff --git a/.local/bin/rofi-surfraw b/.local/bin/rofi/rofi-surfraw similarity index 100% rename from .local/bin/rofi-surfraw rename to .local/bin/rofi/rofi-surfraw diff --git a/.local/bin/vifm/ueberzug b/.local/bin/vifm/ueberzug new file mode 100755 index 0000000..35c201c --- /dev/null +++ b/.local/bin/vifm/ueberzug @@ -0,0 +1,12 @@ +#!/usr/bin/python +# EASY-INSTALL-ENTRY-SCRIPT: 'ueberzug==18.1.5','console_scripts','ueberzug' +__requires__ = 'ueberzug==18.1.5' +import re +import sys +from pkg_resources import load_entry_point + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit( + load_entry_point('ueberzug==18.1.5', 'console_scripts', 'ueberzug')() + ) diff --git a/.local/bin/vifmimg b/.local/bin/vifm/vifmimg similarity index 100% rename from .local/bin/vifmimg rename to .local/bin/vifm/vifmimg diff --git a/.local/bin/vifmrun b/.local/bin/vifm/vifmrun similarity index 100% rename from .local/bin/vifmrun rename to .local/bin/vifm/vifmrun