From f9caed5ddbf0d1c1d995d736338f0a62e36f8d84 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 7 Feb 2021 15:53:58 +0100 Subject: tex2pdf: Simplify mupdf interaction bin/tex2pdf: Simplify the mupdf interaction (i.e. sending SIGHUP) and fix the inkscape call (flag parameters have changed). --- bin/tex2pdf | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'bin/tex2pdf') 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 -- cgit v1.2.3-70-g09d2