Skip to content

Instantly share code, notes, and snippets.

@hoangtranwork
Forked from Saicheg/screenshare
Last active July 6, 2016 12:44
Show Gist options
  • Save hoangtranwork/25e02823da347a0bf4f4213429b4c798 to your computer and use it in GitHub Desktop.
Save hoangtranwork/25e02823da347a0bf4f4213429b4c798 to your computer and use it in GitHub Desktop.
Share screenshots on Ubuntu using Dropbox
#!/bin/bash
################
# Description:
# This script will take screenshot of your desktop
# or only active window ( running with -u param ),
# or a rectangle on screen ( running with -s param ),
# copy it to /Dropbox/Screenshots/ with uniq name
# and save path to clipboard
#################
# Requirements:
# Dropbox
# scrot
# xclip
# notify-send
#################
TSTAMP=`date "+%Y-%m-%d_%H.%M.%S"`
IMAGEPATH="/media/hoang/Data/Dropbox/Screenshots/Screenshot_$TSTAMP.png"
sleep 0.2
scrot $1 $IMAGEPATH
# echo $IMAGEPATH
sleep 0.5
SHORT_URL=$(dropbox sharelink $IMAGEPATH)
echo $SHORT_URL | xclip -selection c
notify-send "Screenshot added" "Screenshot link copied to clipboard: $SHORT_URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment