Free cloudapp alternative

A few of my colleagues and me are using Cloudapp a lot to share screenshots. Lately w were getting fed up with the nagscreens of Cloudapp to pay so i quickly assembled a homebrewn solution for use on our Macbooks.

What we want to do is implement the following workflow:

Whenever we use the default screen-capture functions of OSX (ex: cmd-shift-3 or cmd-shift-4), upload the resulting screenshot to imgur and put the link to the url in our pastebuffer.

How can we do that?

  1. Monitor ~/Desktop for new .png files because OSX dumps screenshots on your Desktop. Here we’re going to use FSWatch.
  2. Fswatch will call a little shellscript to upload to and put the url in our pastebuffer with pbcopy.

1. The upload script

Put the following in ~/scripts/

# Upload image to imgur and put the url to the image in paste-buffer
# You need to register a CLIENT_ID at


# echo "Incoming: $IMAGE" >> /tmp/imgurl.log
if echo $IMAGE | grep -q "Screen Shot.*\.png$" ; then
 #echo "IS SS: $IMAGE" >> /tmp/imgurl.log
 IMGURL=`/curl -s -F "image=@$IMAGE" -H "Authorization: Client-ID $CLIENT_ID" $API_BASE | grep -E -o "<link>(.)*</link>" | grep -E -o "[^<]*"`
 # echo $IMGURL >> /tmp/imgurl.log
 echo $IMGURL | pbcopy
 /usr/local/bin/terminal-notifier -message "$IMGURL" -title "IMGUR Screenshot"

Make sure to make the file executable afterward:

chmod +x ~/scripts/

2. On El Capitan: Send notification

We also want a little notification when the upload is complete. For this we need Terminal Notifier.

brew install terminal-notifier

3. The filesystem watcher

Install FSWatch:

brew install fswatch

Put the following in ~/scripts/

fswatch -0 --event=Created --event=Renamed ~/Desktop/ |xargs -0 -n 1 ~/scripts/

This script needs to be executable:

chmod 755 ~/scripts/

4. Start it automatically on boot

We want to start up the watcher automatically when we boot. For this we use Launchd.

Insert the following in ~/Library/LaunchAgents/com.cjware.imgurl.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
 <string>/Users/<YOUR USER NAME HERE>/scripts/</string>

Touch the log-file:

touch /var/log/cjware_fswatch.log

Make it execute on boot:

launchctl load -w ~/Library/LaunchAgents/com.cjware.imgurl.plist

Leave a Reply

Your email address will not be published.