the Linux Screenshot Uploader (and OS X) from imgur.com/apps
- select area of your screen
- The screenshot is uploaded to imgur
- 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.
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!
Take screenshot & upload:
imgur-screenshot.sh
Upload image file:
imgur-screenshot.sh filename
_Making a selection:_
![Selection](http://i.imgur.com/mZlrX16.png)
(Most are probably pre-installed)
- curl
- grep
Linux only:
- libnotify-bin
- scrot
- xclip (needed for
copy_url
)
OS X only:
- terminal-notifier
- screencapture
- pbcopy (needed for
copy_url
)
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.
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"
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 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