Screenshot selection in 22.04

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.)

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

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

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

settings for change keyboard in GUI are:
settings -> keyboard -> keyboard shortcuts -> Screenshots

TO ADD A CUSTOM SHORTCUTS

settings -> keyboard -> keyboard shortcuts -> custom shortcuts

  1. Custom shortcuts is at the end of list
gnome-screenshot -c -a

Screenshot selection in 22.04

Solution 2

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!

Solution 3

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 command as: sh -c "gnome-screenshot -acf /tmp/test && cat /tmp/test | xclip -i -selection clipboard -target image/png".

Solution 4

You can achieve the same functionality by holding the PrtScr, this presents an option to select which should get you what the original functionality you describe gave you.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply