-#!/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 helheim cat \> /var/www/martlubbers.net/$URL
+echo "http://martlubbers.net/$URL" | cloo.gl | xclip -f | xargs -I{} notify-send {}