Created
April 5, 2013 22:21
-
-
Save andrefs/5323149 to your computer and use it in GitHub Desktop.
Screenshots directly to dropbox with public link in clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creates a screenshot from a region of the display, | |
# uploads it to Dropbox public folder and copies | |
# the link to the clipboard. | |
# | |
# Dependencies: | |
# xfce4-screenshooter | |
# dropbox | |
# x-clip | |
# notify-send | |
DATESTR=`date +%Y%m%d_%H%M%S` | |
TEMPSSDIR="/tmp/screenshots/$DATESTR" | |
SSDIR="$HOME/public_html/Dropbox/Public/screenshots" | |
SSNAME="$DATESTR.png" | |
mkdir -p "$TEMPSSDIR" | |
mkdir -p "$SSDIR" | |
xfce4-screenshooter -r -s "$TEMPSSDIR" | |
if ! [ -e "$TEMPSSDIR"/* ]; then | |
rm -r "$TEMPSSDIR" | |
exit 1 | |
fi | |
mv "$TEMPSSDIR"/*.png "$SSDIR/$SSNAME" | |
rm -r "$TEMPSSDIR" | |
notify-send "Screenshot $SSNAME uploaded to Dropbox. Link is available in your clipboard." | |
LINK=`dropbox puburl "$SSDIR/$SSNAME"` | |
echo -n "$LINK" | xclip -i -selection clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment