-
-
Save rxw1/e403dbbcd635facd9055 to your computer and use it in GitHub Desktop.
Upload Screenshot – Get Link
This file contains 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
<!-- | |
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> |
This file contains 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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really nice and usefull stuff. Makes a lot of fun and my communications more fluently.