The Imgur-Screenshot uploader for Linux/OS X from imgur.com/apps
- select area of your screen
- The screenshot is uploaded to imgur
- Upload screenshot or image file
- Use any screenshot tool
- Edit image before uploading
- Upload anonymously or to your imgur account
- Copy link to clipboard
- Open uplaoded image
- Delete image from disk after upload
- Filenames, links and deletion links are stored
- Get notifications about updates
The edit feature is very interesting for automization with something like ImageMagick, or to quickly add notes.
Clone the repo and check if you have all dependencies installed:
Bind the script to a hotkey or add it to your $PATH for quick access ;)
imgur-screenshot [[-c | --connect] | --check | [-v | --version] | [-h | --help]] | [[-o | --open=true|false] [-e | --edit=true|false] [-l | --login=true|false] [-k | --keep_file=true|false] [file]]
|-h||--help||Show help, exit|
|-v||--version||Print current version, exit|
|--check||Check if all dependencies are installed, exit|
|-c||--connect||Show connected imgur account, exit|
|-o||--open=true|false||override open config
-o is equal to --open=true
|-e||--edit=true|false||override edit config
-e is equal to --edit=true
|-l||--login=true|false||override login config
-lis equal to --login=true
|-k||--keep_file=true|false||override keep_file config|
|file||instead of uploading a screenshot, upload file|
Uploading a screenshot
All you need to do is simply run
Uploading a screenshot to your account
imgur-screenshot --connect # shows you which account you're connected to imgur-screenshot -l
(Most are probably pre-installed)
Tip: Use --check to see what's missing.
- Linux only:
- xclip (needed for
- OS X only:
- terminal-notifier or growlnotify
This will not work on Windows. (maybe with cygwin?)
I have successfully tested this on Ubuntu and OS X.
If this won't work on your OS, create a new issue.
Config options are explained below.
The default config can be overridden at
imgur_anon_key="486690f872c678126a2c09a9e196ce1b" imgur_icon_path="$HOME/Pictures/imgur.png" imgur_acct_key="" imgur_secret="" login="false" credentials_file="$HOME/.config/imgur-screenshot/credentials.conf" file_name_format="imgur-%Y_%m_%d-%H:%M:%S.png" # when using scrot, must end with .png! file_dir="$HOME/Pictures" upload_connect_timeout="5" upload_timeout="120" upload_retries="1" screenshot_select_command="scrot -s %img" # OS X: "screencapture -i %img" screenshot_window_command="scrot %img" # OS X: "screencapture -iWa %img" edit_command="gimp %img" edit="false" edit_on_selection_fail="false" open_command="xdg-open %url" # OS X: "open %url" open="true" log_file="$HOME/.imgur-screenshot.log" copy_url="true" keep_file="true" check_update="true"
The imgur API key used for anonymous upload. Don't change this unless you have a valid key
The imgur API key used to upload to your account.
The imgur API secret. Don't change this unless you have a valid secret and would like to upload to your account.
The path to the imgur favicon file (download here).
Has to be a file in your file system, links do not work.
Will be shown as icon for notifications.
If set to true, the script will try to upload to your account
The file used to store your account credentials
If set to false, the file will be deleted after upload.
The format used for saved screenshots. more info
Optional. The path to the directory where you want your images saved.
Maximum time in seconds until the connection to imgur should be established.
Maximum time the whole upload procedure may take.
Amount of retries that will be done if the upload failed.
Command to create a selective screenshot and save it to
Command to grab the active window and save it to
%imgOn debian, you can use
scrot -u %imgto capture the active window instead of the whole screen (Used when selective screenshot cannot be taken, see #1)
If set to true, make use of edit_command
An executable that is run before the image is uploaded.
The image will be uploaded when the program exits.
%imgis replaced with the image's filename.
When the selective screenshot fails, open the (full screen) image with edit_command (see #1)
An executable that is run after the image was uploaded.
%imgis replaced with the image's filename.
%urlis replaced with the image's URL.
If set to true, open url after image uploaded.
The path to the logfile.
The logfile contains filenames, URLs and errors.
If set to true, the image URL will be copied to clipboard.
If set to false, the file will be deleted. Only deletes screenshots.
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.
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.
If you get a notification like
Something went wrong :(
Information logged to /foo/bar/logfile.log
This probably means that
screencapture -i was unable to make a selective screenshot.
- You pressed the any key during selection
- (OS X / screencapture) you didn't make a selection or pressed Esc.
- Note: This is a bug which I have reported to Apple. It's fixed in OS X Yosemite
- (Linux / scrot)
sleep 0.1in the script didn't help. Try increasing the value
- Note: A short sleep is required, otherwise scrot handles the hotkey you're using for imgur-screenshot as any key to cancel the selection
- 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
screencapture -idirectly and check the outcome