Skip to content

Instantly share code, notes, and snippets.

@zmpeg
Last active November 29, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zmpeg/a4f4e09578c415dfa85c to your computer and use it in GitHub Desktop.
Save zmpeg/a4f4e09578c415dfa85c 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/Pictures/screenshots/"
REMOTEHOST="mjz.me"
REMOTEDIR="/home/matt/public/mjz.me/public/s/"
TIMESTAMP=`date +%s`
WEBHOST="http://tesera.screenshots.s3-website-us-east-1.amazonaws.com/"
mkdir -p $LOCALDIR
screencapture -s "$LOCALDIR/$TIMESTAMP.png"
echo "$WEBHOST$TIMESTAMP.png" | pbcopy
aws s3 cp $LOCALDIR$TIMESTAMP.png s3://tesera.screenshots/
NOTIFY_TITLE="Screenshot Uploaded"
NOTIFY_MSG="Screenshot uploaded to $WEBHOST$TIMESTAMP. A http link has been placed on your clipboard."
osascript -e "display notification \"$NOTIFY_MSG\" with title \"$NOTIFY_TITLE\""
#!/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"
@zmpeg
Copy link
Author

zmpeg commented Aug 23, 2016

Can't get OSX to run on keyboard-shortcut. It runs perfectly through terminal and runs Okay-ish through spotlight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment