update submodules, several small changes
[dotfiles.git] / x / .local / bin / scr
index 85bca85..32e550c 100755 (executable)
@@ -1,9 +1,6 @@
-#!/bin/bash
-[[ "$#" -eq 0 ]] && WINDOW=root || WINDOW="$(xdotool getwindowfocus -f)"
-URL="$(date +%F_%H-%M-%S).png"
-import -window "$WINDOW" -quality 90 png:- | curl -s\
-       -u "ftp@martlubbers.net:$(pass ftp.martlubbers.net/ftp@martlubbers.net)"\
-       -T- "ftp://martlubbers.net/public_html/scr/$URL"
-echo "http://martlubbers.net/scr/$URL" | pee \
-       "xclip -selection clipboard" "xclip"\
-       "xargs -I{} notify-send {}"
+#!/bin/sh -e
+[ "$#" -eq 1 ] && CROP="$(slop -t 0 -f "-crop %g")"
+URL="scr/$(date +%F_%H-%M-%S).png"
+import -window root $CROP png:- | \
+       ssh ygdrassil ssh martlubbers.net "cat \> public_html/$URL"
+echo "http://martlubbers.net/$URL" | cloo.gl | xclip -f | xargs -I{} notify-send {}