Skip to content

Instantly share code, notes, and snippets.

@tonyc
Last active June 26, 2019 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyc/691efe3ffcae178be9a9731e134bee25 to your computer and use it in GitHub Desktop.
Save tonyc/691efe3ffcae178be9a9731e134bee25 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
BASE_DIR="${HOME}/Pictures/uploads"
BUCKET="your-s3-bucket-name"
FILENAME=$(uuidgen).png
FULL_PATH="${BASE_DIR}/${FILENAME}"
gnome-screenshot --area --file=$FULL_PATH
/usr/bin/aws s3 cp ${FULL_PATH} s3://$BUCKET --acl public-read
URL="http://$BUCKET/${FILENAME}"
echo $URL | xclip -in -selection clipboard
notify-send "Screenshot uploaded" $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment