Skip to content

Easy Screenshot Sharing on Linux with Dropbox

by mrchris on May 5th, 2011

My first post on this blog was Simple Secure Screenshot Sharing for Ubuntu. This is an updated, much easier way to do it. Here are the requirements:

  • Linux – Needs no explanation
  • Dropbox – A great way to synchronize and share files. Dropbox makes sharing easy by providing a public link to anything that you place into Dropbox’s “Public” folder.
  • ImageMagick – ImageMagick is a powerful command line image manipulation program. This is what will actually take the screenshots.
  • xclip – A command line utility that allows you to copy to the clipboard from the commandline. It will be used to copy the public url from the Dropbox command line application and send it to the clipboard.

Install Dropbox, xclip, and ImageMagick then save this simple bash script to “~/bin/screenshare”:
#!/bin/bash
#Set the path
IMAGEPATH=~/Dropbox/Public/Screenshot.png
#Save the screenshot to the path
import -window root $IMAGEPATH
#Get the url and send it the clipboard
dropbox puburl $IMAGEPATH | xclip

This assumes that your Dropbox path is in ~/Dropbox. Don’t forget to make it executable with “chmod +x ~/bin/screenshare”.

To take a screenshot, from a command line, run dialog, or any other method of issuing commands type “screenshare”. Alternatively, you could map it to the Print Screen keyboard button. You should be now able to paste your shared screenshot from the clipboard.

From → Linux

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS