Last active
November 29, 2016 16:54
-
-
Save zmpeg/a4f4e09578c415dfa85c to your computer and use it in GitHub Desktop.
shoot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
Can't get OSX to run on keyboard-shortcut. It runs perfectly through terminal and runs Okay-ish through spotlight.