Saves an image from clipboard to a file.
- python2
- PyGTK
Download image-clipboard-to-file.py
and run it with python image-clipboard-to-file.py
.
Note: Some distributions such as Arch Linux renamed Python 2 to python2
instead of python
.
Arch Linux users can install the image-clipboard-to-file package from the AUR.
Thanks to Paweł Pałucha who posted this script on this stackoverflow discussion. I share it here to allow package maintainers to easily package it for their distribution.
I added a single line to the end of the script to make it even more useful:
By adding the sys.exit it is now possible to issue an alternative command when there is no image in the clipboard buffer. I used this to create a "Launcher" button on my desktop:
When an image is in the clipboard buffer and I click the button, gimp will open with the image. Otherwise gimp will open as normal with an empty document.