Skip to content

Instantly share code, notes, and snippets.

@cfstras
Last active July 22, 2019 11:55
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 cfstras/081fe1db2466948a416e165802f93c0c to your computer and use it in GitHub Desktop.
Save cfstras/081fe1db2466948a416e165802f93c0c to your computer and use it in GitHub Desktop.
screenshot script
#!/bin/bash
#
# By Sirupsen @ http://sirupsen.dk
# Small changes by cfstras <c@cfs.im>
#
# Description: Very simple script to make you
# select a region of your screen, which will be captured, and
# then uploaded. The URL will then be injected into your clipboard.
#
# Dependencies:
#
# Imgur Bash Upload Script (http://imgur.com/tools/imgurbash.sh)
# Comment: Must be in path (see below) with the name "imgur" (not imgur.sh)
#
# Scrot
# Comment: Scrot is what takes the actual screenshot.
#
# Xclip
# Comment: Xclip is what makes the script able to inject the direct url
# into your clipboard.
#
# libnotify*
# Comment: Will notify you whenever the direct URL is in the clipboard
#
# Installation:
#
# Move the file to a local bin. And put the path of this bin, into
# your path. (See: www.troubleshooters.com/linux/prepostpath.htm)
#
# From then on, you can either activate it via your terminal, or via
# your window manager or similar, so you can bind it to a keycombination.
#
scrot -s -q 1 -m -z "shot.png"
xclip -selection clipboard -t image/png -i "shot.png"
rm "shot.png"
notify-send --hint=int:transient:1 "Pic is in Clipboard: $url"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment