Screenshot upload script
I wrote up this script to take a screenshot and upload it to my webserver a while ago and I want to share it, so without further adieu, I give you ShotUp:
#!/bin/bash
## Screenshot Upload script
## by Justin Hayes
## variables
# screen capture delay
DELAY='2'
# screen capture quality
QUALITY='100'
# screen capture output format
OUTPUT='jpg'
# directory
DIR='/tmp'
# timestamp
TIMESTAMP=`date +%Y-%m-%d_%H-%M`
# hostname
HOST=`uname -n`
# remote user
RUSER='justin'
# remote host
RHOST='192.168.1.101'
# remote directory
RDIR='/var/www/justin-hayes.com/web/www/files/screenshots'
# web directory
WEBDIR='http://www.justin-hayes.com/files/screenshots'
## let's get down to business...
scrot -q $QUALITY -d $DELAY $DIR/screenshot_$HOST\_$TIMESTAMP.$OUTPUT
scp $DIR/screenshot_$HOST\_$TIMESTAMP.$OUTPUT $RUSER@$RHOST:$RDIR
firefox $WEBDIR/screenshot_$HOST\_$TIMESTAMP.$OUTPUT
Use the script by placing it in /usr/bin and calling the command shotup in the Gnome run dialog box or equivalent for other display environments. Please note that the upload will only work if you've setup SSH public key authentication.
Posted: March 30, 2009 at 1:30pm
Comments
Post new comment