the Linux Screenshot Uploader from imgur.com/apps
(also runs on OS X)
- select area of your desktop
- if you want, edit the screenshot with any program (gimp, image magick, ...)
- the screenshot is uplaoded imgur
- the link is copied to clipboard
- if you want, open the image (URL or file) with any program (browser, image viewer)
There isn't much to do. Check the dependencies below and run.
For fast access bind the script to a key.
Enjoy!
These are often pre-installed on Linux
- curl
- grep
- xclip
- libnotify-bin (Linux only)
- scrot (Linux only)
- terminal-notifier (OS X only)
I will make the script automatically detect this when i'm not lazy.
Using this on OS X is really simple. You just need to make a few changes:
(scrot and libnotify-bin are not required)
- Remove the
sleep
line - Replace
scrot
withscreencapture
- Install
terminal-notifier
(via brew or whatever method you like) - Replace anything with the format of
notify-send -foo -baz -bar "Text1" "Text2"
withterminal-notifier -title "Text1" -message "Text2"
That should be it. If you find anything else that won't work, please create a new Issue.
You can find this at the beginning of the script.
Optional configurations can be commented with a leading #.
-
key
The imgur API key. Don't change this unless you have a valid key
-
ico
Optional. The path to the imgur favicon, download here.
Will be shown as icon for notifications.
-
save
Optional. The path to the directory where you want your images saved.
-
pre
Optional. A prefix that will be prepended to the filename. Filenames are in the format %d.%m.%Y-%H:%M:%S.png.
-
edit
Optional. An executable that is run before the image is uploaded.
%img
is replaced with the image's filename. -
connect
Maximum time in seconds until the connection to imgur should be established.
-
max
Maximum time the whole upload may take.
-
retry
Amount of retries when the upload failed.
-
open
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
The path to the logfile.
The logfile contains filenames, URLs and errors.
key="486690f872c678126a2c09a9e196ce1b"
ico="$HOME/Pictures/imgur.png"
pre="imgur-"
save="$HOME/Pictures/"
#edit="gimp %img"
connect="5"
max="120"
retry="1"
open="firefox %url"
log="$HOME/.imgur-screenshot.log"
On Linux, 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 display an image in full screen.
If you get a notification like
Something went wrong :(
Information logged to /foo/bar/logfile.log
This means that scrot -s
/screencapture -s
was unable to make a selective screenshot.
- Linux: You pressed the any key during selection
- Linux:
sleep 0.1
in the script didn't help. Try increasing - You don't have permission to write the file
- One of the dependencies is not installed
- You don't have your display plugged in >_<
- ?? - run
scrot -s
/screencapture -s
directly and check the outcome