How Auto Save Screen shoot in Ubuntu

Tri Juhari
3 min readMay 10, 2021

The Old Way to Take Screenshots on Ubuntu

Hello guys, on this occasion I would like to share a way to automatically take a screenshot without selecting the directory where the screenshots are stored. So before, on linuxmint, when you are going to do a screenshot, an interactive dialog will always appear, which in my opinion is very annoying, such as having to select the capturing region, the action, and then having to choose where to save it.

Here’s the old way when going to do a screenshoot:

  1. Press the PrintScreen button on the keyboard, then an interactive dialog will appear as below.

2. After selecting the capture type, then choose the Save and press Ok .

3. And then have to choose the location where to store the results of the Screen shoot.

Based on how it works to do a screen shoot in the old way is very time consuming, whereas what we want is to do a screen shoot by simply pressing a button on the keyboard and the results come out immediately without having to choose the location of storage and so on.

How to Quickly Screen shoot in Ubuntu

Therefore here’s an easy way to do a screen shoot in a quick way with a single press of a key on the keyboard and the result immediately comes out. But first you have to go through the configuration stage first. The steps are as follows:

  1. The first step is to create an executable file in .sh format

2.Enter the code as below into the executable file that has been created, you can confirm the code below.

#!/bin/bash
bash -c "gnome-screenshot -f \"$HOME/Pictures/$(date '+Screenshot from %Y-%m-%d %H-%M-%S %N.png')\""

if you want to change the storage location of the screenshoot results you can change the following code “$ HOME/Pictures”

3.Save based on the location of the selected directory.

After saving the executable file, then we set the keyboard shortcut to run the file quickly. The steps are:

  1. Search for “keyboard” on the start button.

2. Choose tab Application Shortcut

3. Then select the add button then a dialog will appear as below.

4.Enter the storage location of the .sh file that has been created and click Ok .

/home/tijeee/screenshoot/screen.sh

5. Then press the keyboard key that will be used as the shortcut.

6. Done. You can do a quick screen shoot with
just press the shortcut key and the system will auto save.

Thank you.

--

--