I used the 'keyboard' section in Cinnamon's Python System Settings application to create a custom shortcut that executes the command
gnome-screenshot -a every time I press the Print Screen key. It does not work as expected. Instead of displaying the cross used to select the portion of the screen to take a screen shot of, the system makes a 'beeping' sound. gnome-screenshot gets executed, and outputs the following to stderr:
** Message: Unable to use GNOME Shell's builtin screenshot interface, resorting to fallback X11. (gnome-screenshot:6577): Gdk-CRITICAL **: gdk_pixbuf_get_from_surface: assertion 'width > 0 && height > 0' failed (gnome-screenshot:6577): Gtk-CRITICAL **: gtk_window_resize: assertion 'width > 0' failed ** (gnome-screenshot:6577): CRITICAL **: Unable to capture a screenshot of any window
Running it from a terminal emulator (virtual console would work if you set the $DISPLAY environment variable and others) works and gives expected results. Occasionally, after pressing the Print Screen key a good ~50 times it will work as expected. Changing the command ran when pressing the Print Screen key to
gnome-screenshot -w works perfectly, but I need to be able to select a portion of the screen to take a screen shot of. This question has been asked here but has no answer (the OP settled with using
gnome-screenshot -w after it being pointed out in the comments that it works). My situation is exactly the same of the OP of the linked post.
So what can I do so I don't have to excessively press the Print Screen key just to take a screen shot?