diff options
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 |