How to install Scrot in Ubuntu?


Scrot is a simple command-line tool to capture screenshots on a Linux system. It uses imlib2 to grab and save screenshots. You can use it in scripts to automate the task of taking screenshots of a specific program at a specific time. You can save the screenshots in different image formats.

In this article, I will discuss how to install and use the Scrot screenshot tool in Ubuntu.

Features of Scrot application

The key features of the Scrot application are –

  • Free and opensource
  • Supports multiple image formats including JPG, PNG, GIF, etc.
  • You can take screenshots of a specific window or a rectangular area on your screen
  • The screenshot’s quality is configurable
  • If required it can be used in corn jobs to automate the task of taking screenshots

How to install Scrot in Ubuntu

Scrot is available in the default Ubuntu repository you can install it by using the apt command in your terminal.

Now before you run a command to install Scrot on your system make sure to refresh the apt package repository by using –

sudo apt update

Next, run the given command to install Scrot on your system –

sudo apt install scrot

Type y and then press the Enter when it asks for your confirmation.

You can verify the installation by using the given command –

scrot -v

This will display the version of Scrot installed on your system.

scrot version

Using Scrot in Ubuntu

The syntax of using the Scrot command-line screenshot tool is given below.

scrot [options] filename

Where you can find a detailed list of options on the man page of the scrot command. To see the man page use –

man scrot

Take a full-screen screenshot –

Use the following command to take a full-screen screenshot of your desktop –

scrot

OR save the screenshot with a specific name –

scrot desktop.png

By default, desktop.png will be saved in your home directory.

full screen desktop

If you want to adjust the quality of the screenshot then use the option -q with scrot command and mention quality from 1 to 100, for example –

scrot -q 90 desktop.png

Take a screenshot of the current window

If you want to take a screenshot of your current window then use the option -u with the scrot command.

scrot -u

OR use  –

scrot -u filename

current window screenshot

Take a screenshot by selecting a specific area

Now if you want to take a screenshot of a specific area on your screen then use the option -s with scrot command. This will allow the rectangular selection of the area which is to be captured on your screen.

scrot -s

OR use –

scort -s filename

specific area screenshot

For more usage of this command see its man page.

Removing Scrot tool from Ubuntu

To remove Scrot tool from the Ubuntu just use the given command –

sudo apt remove scrot -y

Remove unused dependencies by executing –

sudo apt autoremove

Conclusion

You can also use scrot command in scripts to automate the tasks of taking screenshots if required.

For any query or feedback write us in the comments below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.