DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Save a screenshot to Dropbox with a keyboard shortcut

Save a screenshot to Dropbox with a keyboard shortcut

Chase Seibert user avatar by
Chase Seibert
·
May. 20, 12 · Web Dev Zone · Interview
Like (0)
Save
Tweet
2.44K Views

Join the DZone community and get the full member experience.

Join For Free

It's not uncommon for me to call my product manager over to my desk half a dozen times on a given day to look at what I'm working on. To speed things up, I decided to start IMing him screen shots instead. Here is a BASH script that builds on Drjnet's excellent script, but which also allows you to select just a small region of your screen to capture.

#!/bin/bash

# Setup filename for the screenshot
myfile=$(date +%Y%m%d%S).png

#Setup paths to dropbox & full url to new screenshot
dropboxwebpath='http://dl.dropbox.com/u/422013/temp/' # PUT YOUR DROPBOX USERID HERE
dropboxfileurl=$dropboxwebpath$myfile

# see: http://code.google.com/p/xmonad/issues/detail?id=476
sleep 0.2

# Use scrot to take a screenshot and stick it in your dropbox screenshots folder
scrot $myfile -e 'mv $f ~/Dropbox/Public/temp/' -s

#  Put full URL to new screenshot into clipboard
echo $dropboxfileurl | xclip -selection c

Note the sleep; that's important to get around a race condition between scrot and your window manager for access to your mouse/keyboard.

To install as a keyboard shortcut (I have mine bound to Windows + PrtScr), just launch the "Keyboard" app in Ubuntu, and add it under Shortcuts -> Custom Shortcuts.

Dropbox (service) product manager Race condition app Build (game engine) ubuntu Bash (Unix shell) IT

Published at DZone with permission of Chase Seibert, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Take Control of Your Application Security
  • The Engineer’s Guide to Creating a Technical Debt Proposal
  • 10 Steps to Become an Outstanding Java Developer
  • How To Integrate Third-Party Login Systems in Your Web App Using OAuth 2.0

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo