13

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?

Hooked
  • 2,363
  • Can very well be done. Are you always storing the images on the same location? – Jacob Vlijm Apr 18 '16 at 15:36
  • @JacobVlijm I can, though in 99% of these cases I discard the images after I upload them somewhere. Think highlighting something on a screenshot for a git issue or a stack exchange question. – Hooked Apr 18 '16 at 15:42
  • 3
    I think saving to clipboard is perfectly fast enough for me. PrintScreen-copy-to-clipboard (probably Ctrl-Shift-PrtSc?), open Gimp, Ctrl-Shift-V. Done. – wchargin Apr 18 '16 at 20:59
  • Related question: https://askubuntu.com/questions/994235/from-screenshot-to-edit-image – guettli Jan 16 '18 at 14:39

7 Answers7

12

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.

Jacob Vlijm
  • 83,767
10

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

enter image description here

This requires no intermediate storage at all.

  • Execution error for 'Screenshot': GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/Screenshot' – Luis A. Florit Nov 02 '20 at 16:06
  • Luis: Solution for that issue is to invoke with "dbus-launch". Just precede gimp in the invocation with "dbus-launch". For normal interactive usage from CLI you'd just run: dbus-launch gimp & – Blaine Sep 06 '21 at 23:55
  • Hopefully there's a "proper" DBus fix, rather than just dbus-launching GIMP! The built-in screenshotting is so useful. – IBBoard Oct 26 '21 at 19:44
5

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

muru
  • 197,895
  • 55
  • 485
  • 740
JakubK
  • 51
4

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

3

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 here enter image description here

muru
  • 197,895
  • 55
  • 485
  • 740
0

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)

IBBoard
  • 237
-1

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\""\'
Zurd
  • 99