Skip to content

Instantly share code, notes, and snippets.

@rxw1
Forked from joostrijneveld/scpscreenshots.sh
Last active October 25, 2016 17:16
Show Gist options
  • Save rxw1/e403dbbcd635facd9055 to your computer and use it in GitHub Desktop.
Save rxw1/e403dbbcd635facd9055 to your computer and use it in GitHub Desktop.
Upload Screenshot – Get Link
<!--
OS X launchd plist: Copy to ~/Library/LaunchAgents
and launch with launchctl load ~/Library/LaunchAgents/org.asdflabs.screenbla.plist.
Make sure the path to the shell script is correct.
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>org.asdflabs.screenbla.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Users/asdf/.local/bin/screenbla.sh</string>
</array>
</dict>
</plist>
#!/usr/local/bin/zsh
HOST=uni
REMOTE_PATH=public_html/scr
URL=xxx
fswatch -0 ~/Desktop | while read -d "" screenshot; do
if echo $screenshot | egrep -q '/Screen.*png'; then
name=$(md5sum $screenshot | cut -d\ -f1).$screenshot:e
scp -q $screenshot $HOST:$REMOTE_PATH/$name
echo $URL/$name | pbcopy
afplay /System/Library/Sounds/Glass.aiff
fi
done
@rxw1
Copy link
Author

rxw1 commented Mar 19, 2015

Better than CloudApp ^^

@joostrijneveld
Copy link

Heh, afplay is a nice touch!

@rxw1
Copy link
Author

rxw1 commented Mar 24, 2015

As for the latest CloudApp news:

Your CloudApp account is changing on April 2. Most importantly, all free accounts will have a drop limit of 10 drops per month.

This is ridiculous. If I remember correctly, their service was completely free at first. Then we've got 10 uploads per day. Now it's going to be 10 per month? Seriously? I am not amused. :D

@mminski
Copy link

mminski commented Mar 26, 2015

Really nice and usefull stuff. Makes a lot of fun and my communications more fluently.

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