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.)
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.in gnome 42 the default shortcuts for using the screenshots are:
Shift+Print
takes a screenshotPrint
take a screenshot interactivelyAlt+Print
take a screenshot of a windowShift+Ctrl+Alt+R
record a screencast interactivelyWhen you press
ALT+PRINT
throws a messagesettings for change keyboard in GUI are:
settings -> keyboard -> keyboard shortcuts -> Screenshots
TO ADD A CUSTOM SHORTCUTS
settings -> keyboard -> keyboard shortcuts -> custom shortcuts
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!
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 :
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".