prepare for new laptop
[dotfiles.git] / x / .local / bin / scr
index 85bca85..c54bf98 100755 (executable)
@@ -1,9 +1,5 @@
-#!/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
+[ "$#" -ne 1 ] && CROP="" || CROP="-window root"
+URL="scr/$(date +%F_%H-%M-%S).png"
+import $CROP png:- | ssh helheim2 cat \> /var/www/martlubbers.net/$URL
+echo "http://martlubbers.net/$URL" | xclip -f | xargs -I{} notify-send {}