Skip to content

Instantly share code, notes, and snippets.

@luizrabachini
Forked from Saicheg/screenshare
Last active August 29, 2015 14:02
Show Gist options
  • Save luizrabachini/0b4dc633947c5b9d53f6 to your computer and use it in GitHub Desktop.
Save luizrabachini/0b4dc633947c5b9d53f6 to your computer and use it in GitHub Desktop.
A shell script to share desktop screenshots using Dropbox
#!/bin/bash
# ------------------------------------------------------------
# Automatic screenshot sharing integrated with Dropbox
# ------------------------------------------------------------
# Requirements:
# dropbox
# gnome-screenshot
# xclip
# ------------------------------------------------------------
# Adapted from:
# https://gist.github.com/Saicheg/4231551
# ------------------------------------------------------------
DIR_NAME=Screenshots # Name of directory folder in Dropbox (Default: ~/Dropbox/Public/Screenshots)
IMG_FORMAT=png # Screenshot file format (Default: png)
PERSIST_TIME=5 # Lifetime of screenshot (in minutes) (Default: 5)
TSTAMP=`date +%s`
DIR_PATH=~/Dropbox/Public/$DIR_NAME
IMG_PATH=$DIR_PATH/$TSTAMP.$IMG_FORMAT
gnome-screenshot -a -f $IMG_PATH
dropbox puburl $IMG_PATH | xclip -selection c
find $DIR_PATH -name "*.$IMG_FORMAT" -type f -mmin +$PERSIST_TIME -exec rm -f {} \; > /dev/null & # Removes old screenshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment