16

Older versions of Ubuntu allowed us to use Ctrl+Shift+Print screen to prompt the selection of an area and take the screenshot by copying it directly to clipboard.

So, how do we get this back?

I want to stress that the undesirable behaviors of the current screenshot tool are:

  • Having to do an extra click after selecting the area in order to save the screenshot.
  • The image getting saved to a folder in addition to just being copied to the clipboard.

Additionally, how to change the default folder for the screenshots? dconf-editor does nothing for the new tool.


I tried installing gnome-screenshot and setting a custom shortcut with the command:

gnome-screenshot -a -c

It does allow me to select an area, but it does not save it to the clipboard afterwards.

Eduardo
  • 1,183

1 Answers1

8

As muru pointed out in the comments this is an open issue in the gnome project and there is a workaround.

Here is how I solved it:

  1. Install gnome-screenshot:

    sudo apt install gnome-screenshot
    
  2. Install xclip:

    sudo apt install xclip
    
  3. Create the following script:

    #!/bin/bash  
    TMPFILE=`mktemp -u /tmp/screenshotclip.XXXXXXXX.png`  
    gnome-screenshot -af $TMPFILE && xclip $TMPFILE -selection clipboard -target image/png; rm $TMPFILE || echo "" 
    
  4. Save it wherever you want.

  5. Go to Settings → KeyboardView and Customize ShortcutsCustom Shortcuts.

  6. Add it as shown in the following image:

enter image description here


Now for saving the screenshot to a specific folder, I couldn't find a solution for the default GNOME tool, but if you are going to use gnome-screenshot anyway, an option is to create another custom shortcut for printing with gnome-screenshot, with a command like this:

sh -c 'gnome-screenshot -af /path/you/want/it/saved/$(date "+%Y.%m.%d-%H.%M.%S").png'
Eduardo
  • 1,183