Skip to content

Instantly share code, notes, and snippets.

@guyromm
Last active August 29, 2015 13:58
Show Gist options
  • Save guyromm/10286422 to your computer and use it in GitHub Desktop.
Save guyromm/10286422 to your computer and use it in GitHub Desktop.
~/bin/shoot.sh
Alt + Print

This script takes a screenshot, uploads it to an sftp server, and pastes the URL in the clipboard.

Please note that one obviously needs an SFTP account with a static web server configured on the dir in order to use this.

It requires:

xbindkeys
to invoke via a keyboard shortcut
scrot
to take the screenshot
xclip
to copy the URL into the clipboard
notify-send
to put a notification on screen when done

Installation

  1. put .xbindkeysrc in your home directory
  2. put shoot.sh somewhere in your path. make sure the command in .xinbdkeysrc points at the correct location of shoot.sh
  3. In shoot.sh, replace “www/screenshots”, “static” and “static.ezd.lan/screenshots” with the upload dir, sftp host and URL, respectively.

Usage

  1. Press Alt+PrintScreen
  2. Choose the area for your screenshot
  3. Paste the link from your clipboard (middle mouse button) once the notification appeared.
#!/bin/bash
#
# modification of a script By Sirupsen @ http://sirupsen.dk (http://sirupsen.com/a-simple-imgur-bash-screenshot-utility/)
function uploadImage {
(echo progress; echo cd www/screenshots ; echo "put $1"; echo quit)|sftp -b - static
}
IMGNAME="shot-`date +'%Y-%m-%d_%H:%M.%S'`.png"
scrot -s $IMGNAME
uploadImage $IMGNAME
echo "http://static.ezd.lan/screenshots/"$IMGNAME | xclip -i
rm $IMGNAME
notify-send "Done,"$IMGNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment