diff options
author | David Runge <dave@sleepmap.de> | 2021-02-07 15:53:58 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2021-02-07 15:53:58 +0100 |
commit | f9caed5ddbf0d1c1d995d736338f0a62e36f8d84 (patch) | |
tree | 68d1e5f419f243bdfc1172cc17d387ac938aff40 /bin | |
parent | c328c206598185b05cd0f178ce09a776be61fb76 (diff) | |
download | dotfiles-f9caed5ddbf0d1c1d995d736338f0a62e36f8d84.tar.gz dotfiles-f9caed5ddbf0d1c1d995d736338f0a62e36f8d84.tar.bz2 dotfiles-f9caed5ddbf0d1c1d995d736338f0a62e36f8d84.tar.xz dotfiles-f9caed5ddbf0d1c1d995d736338f0a62e36f8d84.zip |
tex2pdf: Simplify mupdf interaction
bin/tex2pdf:
Simplify the mupdf interaction (i.e. sending SIGHUP) and fix the
inkscape call (flag parameters have changed).
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tex2pdf | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/bin/tex2pdf b/bin/tex2pdf index 5ed49b2..6d13513 100755 --- a/bin/tex2pdf +++ b/bin/tex2pdf @@ -1,6 +1,5 @@ #!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' +set -eu initial_pwd=$(pwd) filename="" @@ -66,18 +65,9 @@ create_pdf() { return 0 } -check_mupdf_pid() { - set +e - mupdf_pid="$(ps aux | grep "mupdf ${dirname}/${filename}${output_suffix}" | grep -v "grep" | awk '{print $2}')" - set -e -} - show_pdf() { - check_mupdf_pid echo "mupdf: ${dirname}/${filename}${output_suffix}." - if [ -n "$mupdf_pid" ]; then - kill -SIGHUP "${mupdf_pid}" - else + if ! pkill -u "$(whoami)" -f "mupdf ${dirname}/${filename}${output_suffix}" --signal SIGHUP; then DISPLAY=':0' mupdf "${dirname}/${filename}${output_suffix}" & fi } @@ -104,7 +94,7 @@ render_svgs() { if [ -d "${dir}" ]; then for svg in "${dir}/"*.svg; do if [ -f "${svg}" ]; then - inkscape -D -z -A "${svg%\.svg}".pdf "${svg}" + inkscape -D -o "${svg%\.svg}".pdf "${svg}" fi done fi |