diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-06 14:27:39 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-06 14:27:39 +0200 |
commit | 78582b12232810e1221e746f2c439a54019154fc (patch) | |
tree | 6c8655580727db10f8516b90ed1749acfcf76e60 | |
parent | 6a06676909abd8e900a19138085a7929231f7bf3 (diff) | |
download | xutil-78582b12232810e1221e746f2c439a54019154fc.tar.gz |
wpdf: Note argument errors
-rwxr-xr-x | wpdf | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -7,10 +7,19 @@ IFS=' [ -z "$*" ] && { echo usage: $0 source-file ... 1>&2; exit 1; } +success= for source in "$@"; do - xpdf -remote wpdf-$source ${source%.*}.pdf & + case $source in + *.pdf) echo skipping $source: already a pdf 1>&2 ;; + *) success=1 + xpdf -remote wpdf-$source ${source%.*}.pdf & ;; + esac done -sleep 1 + +[ -z "$success" ] && exit 1 +xdotool search --sync --onlyvisible --class xpdf 1>&- +sleep 0.2 || sleep 1 + watch -i "$@" | while read source; do make ${source%.*}.pdf && xpdf -remote wpdf-$source -reload done |