]> Sergey Matveev's repositories - dotfiles.git/blobdiff - bin/bin/mkss
zsnap sync workability fix
[dotfiles.git] / bin / bin / mkss
index 54aecf92aef7ec68794f8235d958ee518be077b0..a276498b21e743112020b74b3f22a6faca5eabc2 100755 (executable)
@@ -1,9 +1,19 @@
-#!/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
-cwebpl.sh -o $tmp.webp $tmp.png
-paster-tls $tmp.webp > $tmp.txt
+[ "$1" = "root" ] && {
+    root="-window root" || root=""
+    shift
+}
+import $root $tmp.png
+my-cwebpl -o $tmp.webp $tmp.png
+if [ "$1" = no ]; then
+    fn=/tmp/`dd if=/dev/urandom bs=8 count=1 2>/dev/null | xxd -p`.webp
+    mv $tmp.webp $fn
+    echo $fn | tee $tmp.txt
+else
+    paster $tmp.webp > $tmp.txt
+fi
 xmessage -file $tmp.txt