22

I want to make it so that when I press the print screen key on my keyboard, it actually includes the cursor. I know that it is calling gnome-screenshot, but I can't find any way to change the arguments it is using with it. If anyone knows about this, it would be greatly appreciated.

dessert
  • 39,392
  • 12
  • 115
  • 163
ReveredOxygen
  • 383
  • 2
  • 5
  • Not directly answering your question, but other, more advanced screenshot tools like `shutter` have an option to include the cursor or not, and can also do things like delayed screenshots (useful for context menus etc. that would go away when you press a key) or directly edit the resulting image. – Byte Commander May 25 '19 at 14:42
  • 2
    @ByteCommander `gnome-screenshot` also provides delay option. – WinEunuuchs2Unix May 25 '19 at 14:58
  • @ByteCommander https://packages.ubuntu.com/search?keywords=shutter doesn't show shutter for 19.04. – DK Bose May 26 '19 at 12:33
  • Oh, I was not aware of that, thanks @DKBose . Looks like [it got removed from the repos starting in 18.10 due to outdated dependencies](https://www.linuxuprising.com/2018/10/shutter-removed-from-ubuntu-1810-and.html). I hope it will get updated and ported to newer libraries at some point, I really like that tool. – Byte Commander May 26 '19 at 12:40
  • And the author of the link you provided has a ppa: https://launchpad.net/~linuxuprising/+archive/ubuntu/shutter. For simple annotating of images I use the ksnip appimage: https://askubuntu.com/a/1128568/248158 – DK Bose May 26 '19 at 12:55

2 Answers2

18

You can do this with dconf-editor but with command line as well. Here are the gsettings effecting gnome-screenshot:

gnome-screenshot gsettings.png

Use this command to check current settings:

gsettings get org.gnome.gnome-screenshot include-pointer
false

Use this command to turn on the option:

gsettings set org.gnome.gnome-screenshot include-pointer true

Use the same technique for the other gnome-screenshot settings.


Note you can get a list of all settings with gsettings list-recursively. For the screenshot above I used the technique in this answer:

And the one-liner code (works with yad only) is:

gsettings list-recursively | sed 's/  */\n/;s/  */\n/;s/\&/\&/g' | yad --list --title "gsettings" --item-seperator='\n' --width=1800 --height=800 --wrap-width=600 --column=Group --column=Key --column=Setting --no-markup
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
13

man gnome-screenshot tells us that

  -p, --include-pointer
          Include the pointer with the screenshot.

So you'll need to set up a new keyboard shortcut that incorporates -p:

enter image description here

Note that gnome-screenshot has a variety of options described in man gnome-screenshot to

  • capture the active window
  • capture the whole screen
  • capture a selected area
  • take a delayed screenshot

You can make your own shortcuts for each of these activities.

DK Bose
  • 41,240
  • 22
  • 121
  • 214