summaryrefslogtreecommitdiff
path: root/misc/pdfautocompile
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2021-12-27 14:21:24 -0600
committerTimmy Keller <tjk@tjkeller.xyz>2021-12-27 14:21:24 -0600
commit673999f18f1c49e4178101d56a9293e0e20aade1 (patch)
tree8c8a2c13cc31785a5b6ec443502078a4f8ac12e4 /misc/pdfautocompile
parentea8ec2d2776fb7e3ea44c4416fac7e662594f351 (diff)
parent5953ea7eb98b924922bb007c7fc1bac35ff6a4d0 (diff)
downloadscripts-673999f18f1c49e4178101d56a9293e0e20aade1.tar.xz
scripts-673999f18f1c49e4178101d56a9293e0e20aade1.zip
Merge branch 'master' of git.tjkeller.xyz:/var/www/git/scripts
Diffstat (limited to 'misc/pdfautocompile')
-rwxr-xr-xmisc/pdfautocompile39
1 files changed, 0 insertions, 39 deletions
diff --git a/misc/pdfautocompile b/misc/pdfautocompile
deleted file mode 100755
index 3c0d8f4..0000000
--- a/misc/pdfautocompile
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-interactiveopt() {
- # Usage: interactiveopt "options" "prompt" "maxopts (if unset than equal to inf)" "col"
- # Purpose: give the user a numbered list of options. User can specify multiple choices. User can specify either the number or the name of the option.
- # Output: saved in variable "opt"
- unset opt # This won't be set if using recursion, do it in a while loop instead
- while [ -z $opt ] 2>/dev/null; do
- # Column option
- [ -n "$4" ] && [ "$4" = "col" ] \
- && echo "$1" | nl -s': ' | column \
- || echo "$1" | nl -s': '
- # Parse user input
- read -p "$2" choices \
- && choices="$(echo $choices | cut -d' ' -f1-$3)"
- for choice in $choices; do
- case "$choice" in
- [0-9]*) opt="$(echo "$1" | head -"$(echo $choice | tr -cd '[:digit:]')" | tail -1) $opt" ;;
- *) opt="$(echo "$1" | grep "^$choice$" 2>/dev/null) $opt" ;;
- esac || ( echo "Invalid option \"$choice\"" && undet opt && break ) # Why wont this unset opt or break???????
- done
- done
-}
-
-listfiles() {
- pids=$(xdotool search --class "Vim")
- for pid in $pids; do
- names="$(xdotool getwindowname $pid | grep '\.tex')\n$names"
- #$openfiles="$(echo "$name" | cut -d' ' -f1)\n$openfiles"
- #$openfilepaths="$(echo "$name" | awk -F'[()]' '{ print $2 }')\n$openfiles"
- done
- #file="$(echo $openfiles | grep "^$1")"
- [ -z "$file" ] \
- && interactiveopt "$(echo $openfiles | sort -bu | tail +2)" "Which file to autocompile? " 1 \
- && file="$opt"
-}
-
-[ -e "$1" ] && file="$1" || listfiles
-
-echo "$file" | entr pdflatex "$file" || echo "entr or LaTeX is not installed!"