Skip to content

Instantly share code, notes, and snippets.

@iamdeuterium
Forked from Saicheg/screenshare
Last active October 21, 2016 17:55
Show Gist options
  • Save iamdeuterium/3366d6005acd489fc49b7f83beda725e to your computer and use it in GitHub Desktop.
Save iamdeuterium/3366d6005acd489fc49b7f83beda725e to your computer and use it in GitHub Desktop.
Share screenshots on Ubuntu using Dropbox
#!/bin/bash
################
# Description:
# This script will take screenshot and
# copy it to /Dropbox/Public/screenshots/ with uniq name
# and save path to clipboard.
# default: selection
# -f fullscreen
# -w active window
#################
# Requirements:
# Dropbox
# scrot
# xclip
# notify-send
#################
TSTAMP=`date +%s`
IMAGEDIR=~/Dropbox/Public/screenshots
IMAGEPATH=$IMAGEDIR/$TSTAMP.png
if [ ! -d $IMAGEDIR ]; then
mkdir $IMAGEDIR
fi
case "$1" in
"-f" ) OPTIONS="-d 3";;
"-w" ) OPTIONS="-d 3 -u -b";;
* ) OPTIONS="-s"
esac
scrot $OPTIONS $IMAGEPATH
dropbox sharelink $IMAGEPATH | xclip -selection clipboard
notify-send "Screenshot" "Screenshot link copied to clipboard."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment