aboutsummaryrefslogtreecommitdiff
path: root/wpdf
blob: 3e0e1aa52a7da560768f2dc061c116f943422f6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# wpdf -- view, watch and remake pdf

IFS='
'

[ -z "$*" ] && { echo usage: $0 source-file ... 1>&2; exit 1; }

for source in "$@"; do
	xpdf -remote wpdf-$source ${source%.*}.pdf &
done
sleep 1
watch -i "$@" | while read source; do
	make ${source%.*}.pdf && xpdf -remote wpdf-$source -reload
done