Can I take a screenshot and directly open it in Gimp?

Common use case for me and printscreen:

  • Hit printscreen and save .png
  • Open up Gimp
  • Find file I've saved
  • Edit file (crop and highlight regions)

It seems like the first three steps could be combined into a single key bind, e.g. printscreen auto opens Gimp, ready to edit. Is that possible?

4

7 Answers

Quick version

Literally doing what you asked; in one action:

  • Take a screenshot
  • Save it in your preferred directory
  • Opening it with Gimp

    enter image description here

The script

#!/bin/bash
picsdir=~/Pictures/out.png
gnome-screenshot -f "$picsdir"
gimp "$picsdir"

How to use

  • Copy the script into an empty file, save it as take_ashot.sh
  • Set your preferred directory to save the files in, in the line:

    picsdir=~/Pictures/out.png

    I'd leave it as it is if your system is English, else you'd need to change the Pictures folder name.

  • Test-run it by the command:

    /bin/bash /path/to/take_ashot.sh
  • If all works fine, add it to a shortcut: Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

    /bin/bash /path/to/take_ashot.sh

Note

Since you mentioned not to save the source file in most cases, I made the script overwrite previous files. If you don't want that, we'd need to build in a few renaming- lines.

2

Why not just take the screenshot with Gimp? File > Create > Screenshot.

enter image description here

This requires no intermediate storage at all.

3

With xfce4-screenshooter you can choose from programs to open screenshot with, or save it. Supports selecting area, delay before taking screenshot. Directly point-and-click solution.

xfce4-screenshooter screen

For xfce and Xubuntu users, the action can be achieved with the following command:

xfce4-screenshooter -f -o gimp

To implement, change the shortcut in Settings -> Keyboard, as shown below:

enter image description here

If you're willing to switch screenshot applications, this is an option that scrot provides:

 -e, --exec APP Exec APP on the saved image.
…
EXAMPLE scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' This would create a file called something like 2000-10-30_2560x1024.png and move it to your shots directory.

So, you could change the PrntScr shortcut to run:

scrot -e 'gimp $f'

Shutter, another screenshot application, provides some editing facilities itself, so you might not even need to start GIMP at all.

enter image description hereenter image description here

If you're running Gnome then you can use the built-in screenshot shortcuts to at least bypass the "save to disk and open the file" step.

  1. Press the appropriate "to clipboard" shortcut (basically the standard "save to file" shortcut with Ctrl):
    • Ctrl+PrintScreen
    • Ctrl+Alt+PrintScreen to capture a window
    • Ctrl+Shift+PrintScreen to capture an area
  2. Open GIMP
  3. If there are no images open in GIMP, Ctrl+V pastes as a new image

The shortcuts are configurable in Gnome Settings under Keyboard > View and customise shortcuts > Screenshots.

Screenshot of Gnome Settings for screenshotting

I've disabled saving screenshots because I use custom shortcuts with gnome-screenshot to save to ~/temp/ rather than ~/Pictures/ (because I care about Pictures but not about anything in temp, like random screenshots)

For Linux Mint version Mate, just run the commands below to configure your system once and press the PrtScn on your keyboard.

sudo apt install scrot
gsettings set org.mate.Marco.global-keybindings run-command-screenshot "disabled"
dconf write /org/mate/desktop/keybindings/custom0/action \'"scrot -e \"gimp \$f\""\'
dconf write /org/mate/desktop/keybindings/custom0/binding \'Print\'
dconf write /org/mate/desktop/keybindings/custom0/name \'PrintScreen\'

The screenshot will be saved in your home folder at ~/ if you don't want them there, you can always use this below to move the screenshot in the /tmp folder:

dconf write /org/mate/desktop/keybindings/custom0/action \'"scrot -e \"mv \$f /tmp; gimp /tmp/\$f\""\'

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like