Skip to content

Instantly share code, notes, and snippets.

@fpigerre
Created August 27, 2013 09:10
Show Gist options
  • Select an option

  • Save fpigerre/6351372 to your computer and use it in GitHub Desktop.

Select an option

Save fpigerre/6351372 to your computer and use it in GitHub Desktop.
Screenshot Shell Script from md_5
#!/bin/sh
BUCKET="au.files.md-5.net"
FILE_DIR="$HOME/Pictures/Screenshots"
###############################################################################
###############################################################################
###############################################################################
FILE_NAME="$(cat /dev/urandom | tr -c -d '[:alnum:]' | head -c 5).png"
FILE_PATH="$FILE_DIR/$FILE_NAME"
mkdir -p "$FILE_DIR"
gnome-screenshot -a -f "$FILE_PATH"
if [ -f "$FILE_PATH" ]
then
s3cmd sync "$FILE_DIR/" "s3://$BUCKET"
UPLOAD_URL="http://$BUCKET/$FILE_NAME"
echo "$UPLOAD_URL" | xsel -b -i
notify-send Screenshot "$UPLOAD_URL copied to clipboard" -i "$FILE_PATH" -t 1000
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment