Ubuntu – How to autosave screenshots in Ubuntu 17.04

17.04screenshot

I already know of the Prt Scrn key method of taking a screenshot in Ubuntu. Which when press takes a screenshot and prompts you to save it.

for example:

enter image description here

Is there anyway to have Ubuntu save the screenshot automatically without prompting me to save?

Best Answer

You can do it in a simple way:

  1. Open "CompizConfig Settings Manager". If you don't have it installed, you'll need to install it.

  2. Click on Commands and enable it.

  3. Choose one empty Command line field, e.g. 0, and input: gnome-screenshot -f $HOME/Pictures/"Screenshot from $(date +%Y-%m-%d%t%H-%M-%S)".png

  4. In the Key Bindings tab, in Run Command 0, enable it by clicking on the button which says Disabled -if it was not previously configured- and ticking the checkbox saying Enabled.

  5. Click on Grab Key Combination and press Prt Scr. It may show you a warning saying that the key is already used by Take a Screenshot and allows you to disable it. Disable Take a screnshot and everything should work as you want. If the warning is not shown, open System Settings -> Keyboard -> Shortcuts -> Screenshots and disable or change the shortcut "Take a screenshot".

Basically, no need to install other screenshot software, or deal with scripts. Gnome-screenshot knows how to autosave if you provide the save path. Of course, feel free to choose a different save path or date/time format, in the example I used a similar one to the default. You can also change other options as in grabbing just the current window, etc; you may see the available options in gnome-screenshot --help. This solution works with older versions of Ubuntu as well, e.g. 16.04.