47

I use MATE as desktop viewer. How can I add a shortcut for taking a screenshot of a part of the windows and copy it to the clipboard? Basically what with gnome the command control-shift-stamp.

matteo
  • 873
  • 1
  • 8
  • 13

5 Answers5

68

There are a set of keyboard shortcuts in Ubuntu specifically for screenshots.

Go to System Settings > Keyboard > Shortcuts > Screenshots. In my case it is Ctrl+Shift+Print_Screen

Keyboard Shortcuts

David Foerster
  • 35,754
  • 55
  • 92
  • 145
25

I found out the solution. First, open the shortcut dialog window and press add to add a new shortcut. Then paste this code:

gnome-screenshot -a -c

For other useful gnome-screenshot command, from the terminal: gnome-screenshot --help

matteo
  • 873
  • 1
  • 8
  • 13
  • 1
    It would be good for other readers, if you accept your own answer (see [Can I answer my own question?](/help/self-answer)). – David Foerster Mar 17 '15 at 18:23
  • 1
    You have to do this manually starting in Gnome 41+ - what I'm finding is that occasionally my shortcut just stops working... but perhaps that's another issue to figure out. – Jmoney38 Jul 07 '22 at 19:38
  • 1
    -c doesn't do anything in Ubuntu 22.04 it seems. the image is not copied to the clipboard – Hilikus May 11 '23 at 01:03
  • @Hilikus нужно установить xclip (sudo apt install xclip) – dima.rus Jun 08 '23 at 19:19
14

For Gnome, copying portion of the screen to clipboard is Ctrl+Shift+PrtScrn.

anatoly techtonik
  • 2,401
  • 4
  • 32
  • 40
2

It looks like they've recently removed this in the newest versions on GNOME, but you can reinstate it by combining some of the existing answers here, specifically:

  1. Go to Settings > Keyboard > View and Customize Shortcuts > Custom Shortcuts.

  2. Click the + and create a new shortcut with:
    Command gnome-screenshot -acf /tmp/gnome-screenshot-area
    Shortcut Shift + Ctrl + Print

Note: saving the screenshot to file is intentional (thanks @grabantot).

Another note: I switched back to Wayland, which seems to have broken this method.

Custom Shortcut

c24w
  • 149
  • 6
  • 1
    The screenshot doesn't appear in the clipboard. I believe this is due to some issue with gnome that it doesn't preserve the values in clipboard after the application that added the value exits or something like that. Had a similar issue with using xclip in scripts. – grabantot Jul 04 '22 at 13:01
  • 2
    Found the solution here https://askubuntu.com/a/1212806/626636 – grabantot Jul 07 '22 at 20:58
  • If you're having this issue after upgrading to Ubuntu 22, use this solution and change your window management to "Ubuntu Xorg". The way to do this is simple: logout as your user, then in the bottom right corner of the login screen click on settings and select "Ubuntu on Xorg". – waykiki Dec 20 '22 at 11:44
  • @waykiki yes, the important part is using Xorg, rather than Wayland. – c24w Dec 21 '22 at 12:05
0

I had some issues with getting the custom selection to copy to clipboard. What worked for me is: gnome-screenshot --area -c