Skip to content

Instantly share code, notes, and snippets.

@jduckles
Created March 29, 2010 19:34
Show Gist options
  • Save jduckles/348303 to your computer and use it in GitHub Desktop.
Save jduckles/348303 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Streamlined workflow for capturing screen shots and uploading them to my website.
# Assumption: you have keypairs set up for ssh with the target HOST
read -p"Enter filename (no extension): " NAME
HOST=jduck.net
DIRECTORY=www/files
REMOTE=${HOST}:${DIRECTORY}/${NAME}
TMPFILE=/tmp/${RANDOM}.scap
# Use in interactive mode to select the part of the screen to capture
screencapture -ix ${TMPFILE}
scp ${TMPFILE} ${REMOTE}.png
WEBDIR=$(basename ${DIRECTORY})
echo "URL: http://${HOST}/${WEBDIR}/${NAME}.png"
rm ${TMPFILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment