screencap dropbox

A little script for automating screencap pasting via Dropbox. Nice if you bind it to a couple keys:

C-PrintScreen dbcap
S-PrintScreen dbcap -s

and etc ...

#!/bin/bash
# use Dropbox like cap.sprunge.us
# requires scrot and xclip

cap=~/"Dropbox/Public/screen.jpg"

[ -d "$(dirname $cap)" ] || exit
scrot $* $cap || exit
dropbox puburl $cap | xclip -i -f