Skip to content

Instantly share code, notes, and snippets.

@whyvez
Forked from zmpeg/shoot-osx.sh
Created November 9, 2015 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whyvez/8c7fdb7a8286121d4fcd to your computer and use it in GitHub Desktop.
Save whyvez/8c7fdb7a8286121d4fcd to your computer and use it in GitHub Desktop.
shoot
#!/bin/bash
#
# Takes a screenshot, puts the URL in your clipboard,
# Then syncronizes the screenshot to your configured host
LOCALDIR="$HOME/documents/screenshots/"
REMOTEHOST="mjz.me"
REMOTEDIR="/home/matt/public/mjz.me/public/s/"
TIMESTAMP=`date +%s`
WEBHOST="http://mjz.me/s/"
echo $LOCALDIR
mkdir -p $LOCALDIR
scrot -s "$LOCALDIR/$TIMESTAMP.png"
echo "$WEBHOST$TIMESTAMP.png" | xclip -selection c
notify-send "Saved locally as $TIMESTAMP.png.\nClipboard already available.\nSyncronizing..."
rsync -avzru --delete-excluded $LOCALDIR $REMOTEHOST:$REMOTEDIR
notify-send "Complete. $WEBHOST$TIMESTAMP"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment