67

I am trying to configure the 22.04 (Gnome 42) keyboard shortcut to get the "old" functionality of taking screenshots of area selections and pasting them into clipboard (Ctrl + Shft + PrtScr + select/release: done). The problem is that $ gnome-screenshot -ac doesn't copy the selection into clipboard unless there is an instance of gnome-screenshot utility running. Does anyone know how to work around this issue? (I know it is possible to run the "new" interactive screenshot tool, but that takes too many clicks and is not what I want.)

Edit: The issue has been fixed: gnome-screenshot -ac works as intended in Gnome 43.4 or perhaps even in the earlier versions.

Pablo Bianchi
  • 17,371

7 Answers7

48

After installing Ubuntu 22.04

after you log out or restart the computer, the old gnome-screenshot is removed, so you need to reinstall it to make the old command to work.

sudo apt install gnome-screenshot

Add a Custom ShortCuts

Settings → keyboard → keyboard shortcuts → custom shortcuts

Custom shortcuts are at the end of list

gnome-screenshot -c -a

I'm using Shift + Ctlr + Delete shortcut so that it doesn't interfere with the new 42 screenshot shortcuts."

enter image description here

In gnome 42 the default shortcuts for using the screenshots are:
  1. Shift+Print takes a screenshot
  2. Print take a screenshot interactively
  3. Alt+Print take a screenshot of a window
  4. Shift+Ctrl+Alt+R record a screencast interactively

When you press ALT+PRINT throws a message

you can paste the image from the clipboard

To change keyboard shortcuts in GUI:

Settings -> keyboard -> keyboard shortcuts -> Screenshots.

Pablo Bianchi
  • 17,371
AlexPixel
  • 637
20

So this is what I did on my Ubuntu 22.04

Note this is for capturing an area onto the clipboard.

Install Gnome Screenshot: sudo apt install gnome-screenshot

Make sure that Xclip is installed. To install :

sudo apt install xclip

Create a custom keyboard shortcut. I used Ctrl + shift + Print Screen with the following command: sh -c "gnome-screenshot -acf /tmp/test && cat /tmp/test | xclip -i -selection clipboard -target image/png".

lazyrook
  • 209
11

The -c command to copy the screenshot to the clipboard has a weird bug that doesn't copy the image when using -a to grab a selection.

A way to fix this is to make the command save the screenshot by adding --file={/filepath/filename.png} after the -a -c.

The command all together is gnome-screenshot -a -c --file={/filepath/filename.png}.

I don't know why this fixes the bug but it definitely works so you can try that.

Hope this is what you wanted @Iiro Ullin. Good luck!

Toodoo
  • 103
9

You can select the part of the screen to screenshot by holding the PrtScr button.

This presents an option to select which should allow you to do a screen shot selection (which is what Ctrl+Shift+PrtScr used to do).

8

Just press PrtScr then define your selection and press Ctr+C to Copy the Image to your Clipboard.

Detrua
  • 81
4

Add this command as a custom shortcut

bash -c 'gnome-screenshot -a -c --file="$HOME/Pictures/screenshot.$(date +%Y%m%d_%H%M%S).png"'

Such as shift+alt+print

Then you can press the shortcut and select areas, file is saved in the location with timestamp -- exactly the same behavior as old Ubuntu.

aaronsun
  • 41
  • 2
3

I get the concern about the new PrtScr tool requiring more clicks, but playing around with a bit I found two ways to get closer to the old user experience:

  • if you use right-click to make the selection, you can click within an existing selection without problem.
  • you can use space to take the picture