#!/bin/bash # A simple screenshot -> URL program. # # Released into the public domain on Thu Jul 31 15:54:43 EDT 2008 # by Steve Pomeroy # # requires: # imagemagick openssh-client xclip # need ssh access to this remote_host='staticfree.info'; # the webroot should map to the filesystem at remote_url # without a trailing slash. remote_url="http://staticfree.info" rh_webroot="/home/steve/web"; # this path should exist before running this script rh_archive="oldshots"; ### end config ### file=scap-$(perl -e'print time()').png; import -comment "Screenshot taken of `hostname -s` by `whoami`" png:- | ssh $remote_host "cat > $rh_webroot/$rh_archive/$file"; full_url="$remote_url/$rh_archive/$file"; echo "Screenshot saved as $full_url"; echo $full_url | xclip -i