Here is an example:
In this case, the scrot will wait 5 seconds and then take a screenshot.
Countdown before screenshot:
This tool also allows you to display the countdown while using the time delay option. This feature can be enabled using the -c command line option.
scrot –delay [NUM] -c
scrot -d 5 -c
Here is a screenshot for example:
Image quality:
Using this tool, you can adjust the quality of screenshots at a rate of 1-100. High value means large size and low compression. The default value is 75, although the effect varies depending on the selected file format.
You can access this feature by using the --quality or -q option, but you must assign a numeric value for this option from 1-100.
scrot –quality [NUM]
scrot -quality 10
Below is a sample photo:
So, you can see that the quality of the image is greatly reduced when the -q option is assigned a value close to 1.
Create thumbnail:
This utility also allows you to create thumbnails of screenshots. This feature can be accessed using the --thumb option. This option requires a NUM value, which is basically the percentage of the original screenshot size.
script --thumb NUM
scrot --thumb 50
Note: --thumb option ensures that screenshots are captured and saved at the original size.
For example, this is the original screenshot taken:
And the following are saved thumbnails:
Show multiple screenshots:
In case your device has multiple monitors attached, scrot allows you to take and display screenshots of all these screens. This feature can be accessed with the -m command line option.
scrot -m
Below is a sample photo:
Perform actions on saved photos:
Using this tool, you can perform various operations on saved images - for example, opening a screenshot in the image editor like gThumb. This feature can be accessed with the -e command line option. Here is an example:
scrot abc.png -e 'gthumb abc.png'
Here, gthumb is the image editor that will automatically launch after the user runs the command.
The following is a snapshot of the command:
And this is the result of the above command:
So you can see that the scrot command took the screenshot and then launched the gThumb image editor with the image taken as an argument.
If you do not specify a name for the screenshot, the snapshot will be saved with the file name with a date stamp in your current directory - this, as we mentioned earlier, is the default behavior of the collection process.
This is an example of the command -e option, which scrot uses the default name for the screenshot:
scrot -e 'gthumb $ n'
It is worth mentioning that $ n is a special string, providing access to the screenshot name. For more details on special sequences, go to the next section.
Special series:
The -e (or --exec) parameters and file names can use formatters when used with scrot. There are two types of parameter formats. The first type is the preceding character '%' used for date and time formats, and the second type is for internal filtering and the prefix is '$'
Some specifiers are identified by the --exec parameter and the file name below.
For example:
scrot ashu.jpg -e 'mv $ f ~ / Pictures / Scrot / ashish /'
Below is a sample photo:
If you do not specify a file name, then the script will by default save the snapshot in a date stamped file format. This is the date stamp file format by default used in scrot:% yy-% mm-% dd-% hhmmss_ $ wx $ h_scrot.png
scrot abc.jpg -e 'echo $ s'
Here is a sample photo:
Similarly, you can use other special strings $ p, $ w, $ h, $ t, $$ and n to provide access to image pixel size, image width, and image height. , image format, $ symbol and grant new line access respectively. For example, you can use these strings in the same way as the $ s example we discussed above.
This utility is easy to install on Ubuntu systems, the use is also quite simple for beginners. Scrot also provides some advanced features like special strings that can be used by professionals. You can find out more in case you want to use them.
See more: