Git Product home page Git Product logo

imgur-screenshot's Introduction

the Linux Screenshot Uploader (and OS X) from imgur.com/apps

Imgur-Screenshot

A desktop notification
Notification

  1. select area of your screen
  2. The screenshot is uploaded to imgur

Features

  • You can edit the screenshot with any program (GUI or CLI) before uploading
  • The link can be copied to clipboard
  • Normal image files can be uploaded, too
  • You can open the URL or file with any program (browser, image viewer) after upload
  • The screenshot can be saved or deleted from disk
  • All filenames + URLs (and errors) are logged
  • The program can check for updates

The edit feature is very interesting for automization with something like ImageMagick, or to add notes with a GUI editor.

Installation

Check if you have all dependencies installed:

imgur-screenshot.sh check

That's it. You can bind the script to a hotkey or add it to your $PATH for quick access ;)

Enjoy!

Usage

Take screenshot & upload:

imgur-screenshot.sh

Upload image file:

imgur-screenshot.sh filename

_Making a selection:_
![Selection](http://i.imgur.com/mZlrX16.png)

Dependencies

(Most are probably pre-installed)

  • curl
  • grep

Linux only:

  • libnotify-bin
  • scrot
  • xclip (needed for copy_url)

OS X only:

Config

You can find this at the beginning of the script.
Optional configurations can be commented with a leading #.

  • imgur_key

    The imgur API key. Don't change this unless you have a valid key

  • imgur_icon_path

    Optional. The path to the imgur favicon, download here.
    imgur favicon Will be shown as icon for notifications.

  • save_file

    If set to false, the file will be deleted after upload.

  • file_prefix

    Optional. A prefix that will be prepended to the filename. Filenames are in the format %d.%m.%Y-%H:%M:%S.png.

  • file_dir

    Optional. The path to the directory where you want your images saved.

  • edit_command

    Optional. An executable that is run before the image is uploaded.
    %img is replaced with the image's filename.

  • upload_connect_timeout

    Maximum time in seconds until the connection to imgur should be established.

  • upload_timeout

    Maximum time the whole upload procedure may take.

  • upload_retries

    Amount of retries that will be done if the upload failed.

  • cupy_url

    If set to true, the image URL will be copied to clipboard.

  • open_command

    Optional. An executable that is run after the image was uploaded.
    %img is replaced with the image's filename.
    %url is replaced with the image's URL.

  • log_file

    The path to the logfile.
    The logfile contains filenames, URLs and errors.

  • check_update

    If set to true, it will check for updates after the upload. This will not apply the update, just notify you if there's a new version.

imgur_key="486690f872c678126a2c09a9e196ce1b"
imgur_icon_path="$HOME/Pictures/imgur.png"
save_file="true"
file_prefix="imgur-"
file_dir="$HOME/Pictures"
edit_command="gimp %img"
upload_connect_timeout="5"
upload_timeout="120"
upload_retries="1"
copy_url="true"
open_command="firefox %url"
log_file="$HOME/.imgur-screenshot.log"
check_update="true"

Note

The screenshot will be taken after the selection has been made. This could be annoying if you want to capture something quickly and then want to select an area. I might implement this as a FutureFeature™ when I find a decent way to capture the whole screen, display the shot in full screen and then crop it to a selection.

Troubleshooting

If you get a notification like

Something went wrong :(
Information logged to /foo/bar/logfile.log

This probably means that scrot -s/screencapture -s was unable to make a selective screenshot.

  • You pressed the any key during selection
  • (Linux) sleep 0.1 in the script didn't help. Try increasing the value
  • You don't have permission to write the file
  • One of the dependencies is not installed
  • You don't have your display plugged in (wrong terminal?) >_<
  • ?? - run scrot -s/screencapture -s directly and check the outcome

imgur-screenshot's People

Contributors

agung-wete avatar hawur avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.