-#!/bin/sh -ex
+#!/bin/sh -e
sleep 1
tmp=`mktemp`
trap "rm -f $tmp $tmp.png $tmp.webp $tmp.txt" HUP PIPE INT QUIT TERM EXIT
-import $tmp.png
+[ "$1" = "root" ] && root="-window root" || root=""
+import $root $tmp.png
cwebpl.sh -o $tmp.webp $tmp.png
-paster-tls $tmp.webp > $tmp.txt
+paster $tmp.webp > $tmp.txt
xmessage -file $tmp.txt