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
@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