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