diff --git a/upload_screenshot.sh b/upload_screenshot.sh index e02d8c5..7968193 100755 --- a/upload_screenshot.sh +++ b/upload_screenshot.sh @@ -1,5 +1,27 @@ #!/bin/sh +# upload_screenshot.sh takes a screenshot and load it up +# to a specified place on your server and copies the URL +# to the pasteboard so you can paste it in a chat, mail, etc. +# You have to use SSH login without password +# +# You can pass it a parameter with a differens file name (without .png), +# without it the filename will be latest.png +# +# I recommend to use Quicksilver to start this script. You have to chmod 755 it +# before you can run it. +# +# Autor: Jeena Paradies +# This script is public domain. +# This script is OS X only. + +# scp style server path: +server_path="me@example.com:~/htdocs/screens/" + +# url to the server +server_url="http://example.com/screens/" + + filename=$1 if [ -z $1 ]; then filename="latest"; fi @@ -7,8 +29,8 @@ screencapture -i "/tmp/latest-screenshot.png" if [ -r /tmp/latest-screenshot.png ] then - scp /tmp/latest-screenshot.png me@example.com:~/htdocs/s/$filename.png + scp /tmp/latest-screenshot.png $server_path$filename.png rm /tmp/latest-screenshot.png - echo "http://example.com/s/$filename.png" | pbcopy + echo "$server_url$filename.png" | pbcopy growl -nosticky "Screenshot ready" fi