4 die
() { echo "$1" >&2; exit 1; }
6 cachedir
="${XDG_CACHE_HOME:-$HOME/.cache}/llpp"
7 test -d "$cachedir" || die
"cache directory '$cachedir' does not exist"
9 command -v prince
>/dev
/null
2>&1 ||
{ die
"$0: need princeXML to work"; }
11 css
=$HOME/xsrc
/llpp
/misc
/prince.css
12 test -e "$css" ||
unset css
13 while getopts c
:f opt
; do
17 ?
) die
"usage: $0 [-c css] url";;
20 shift $
(($OPTIND - 1))
21 test -z "$1" && die
"usage $0: url"
24 set -- $
(echo "$url" |
md5sum)
25 pdf
="$cachedir/$1.pdf"
27 ${force-$(test ! -e "$pdf")} && prince
${css:+--style $css} -o "$pdf" "$url"
28 exec llpp
-origin "$url" "$pdf"