Sometimes we use screenshots for ourselves, sometimes for transferring something to others. Windows users can take screenshots with the Print Screen button. So, How to take screenshot in Linux?
In Linux, each desktop environment (Gnome, XFCE, KDE, Deepin) brings its own screenshot application. Although they perform almost similar tasks, the preferences of the users also determine the application to be used. Now let's examine a few desktop applications.
Linux Screenshot Tools for Desktop Environments
1. Gnome Desktop (gnome-screenshot)
The default screenshot application in this desktop environment is gnome-screenshot.
On Windows, users take a screenshot with a keyboard shortcut and paste it into an application and use it. You can take a screenshot with keyboard shortcuts like in Windows or by opening the gnome-screenshot application.
When you open the application;
- Screen : Takes a screenshot of all screens. (Print Screen key from keyboard)
- Window: Screenshot of the selected window is taken. (Alt + Print Screen key from keyboard)
- Selection: With this option, the selection made with the mouse is taken as a screenshot (Shift + Print Screen key from the keyboard)
- Show Pointer: If the option is turned off, the mouse cursor will not be shown on the captured screenshot.
- Delay in Seconds: You can take a screenshot within the time given in the option. When the value is 0, the screenshot is taken as soon as you click the Take Screenshot button.
By default, screenshots are taken to the images directory under the user's home directory. If the images directory is not found, it will be saved in the user's home directory.
When the screenshot is taken with the application, you will see the following screen;
The screenshot taken in this way can be named, the save directory can be changed, and a copy to clipboard can be made instantly.
If you are going to use the screenshot you took in an application (LibreOffice Writer, Pinta etc.), you should also add the CTRL key to the keyboard keys.
- Screen: CTRL + Print Screen
- Window: CTRL + Alt + Print Screen
- Selection: CTRL + Shift + Print Screen
After taking a screenshot with these keys, all you have to do is go to that application and paste it.
2. XFCE Desktop (xfce4-screenshooter)
XFCE desktop screenshot application is xfce4-screenshooter.
xfce4-screenshooter offers Open with and Host on Imgur (A free online image hosting service) options.
3. KDE Desktop (Spectacle or Ksnapshot)
Spectacle (Formerly Ksnapshot) is used in this desktop environment.
It offers more options than other screenshot tools. The directory address to be saved by default, file name format, full screen/current screen features make this application different.
4. Deepin Desktop (deepin-screenshot)
The application used in this desktop environment is deepin-screenshot.
It offers use with a simpler appearance. It allows instant editing (icon, text, etc.) and making changes on the screenshot taken.
Linux Screenshot Tools for Command Line Environments
There are applications that you can install and use independently of the desktop environment.
1. GIMP
If you're using GIMP, you don't need a screenshot tool. You can take a screenshot by following the File – Create – Snapshot path.
2. ImageMagick
Let's take a few examples of taking screenshots via terminal in ImageMagick, another image editing application.
First, let's show a few examples of taking screenshots on the local system. You can take a screenshot of the entire screen to the directory you are in by running the following command in the terminal;
foc@pardus:~$ import -window root screenshot.png
You can specify the screenshot size to be taken;
foc@pardus:~$ import -window root -resize 1024x768 screenshot.png
Run the following command to select a region;
foc@pardus:~$ import screenshot.png
After this command, it will ask you to select an area. Then a screenshot is taken to the directory you are in in the terminal.
To take a screenshot after a certain time;
foc@pardus:~$ import -delay 200 -window root screenshot.png
You can also take screenshots from remote systems with ImageMagick. We will use the -display parameter for this.
For example, let's say you want to take a screenshot from a system you connect via ssh. For this, you need to know which user and which screen number is logged on to the system you are connected to. Who and w commands, the user can get screen number and screen information;
foc@pardus:~$ who foc tty7 2022-07-19 21:51 (:0) foc pts/0 2022-07-19 21:51 (:0) foc pts/2 2022-07-19 22:35 (192.168.122.1)
As seen in the above command output, foc user uses display number :0. Let's take a screenshot;
foc@pardus:~$ import -display :0 -window root screenshot.png
If the -window parameter is not given, it waits for the user on the remote system to click anywhere with the mouse. With this parameter, the entire screen is captured without waiting for anything from the user. Check out the manual page in the terminal for more parameters;
foc@pardus:~$ man import
3. Gnome Screenshot
Above, we have explained the steps to take screenshots with the graphical interface. Now let's look at the steps to take screenshots from the terminal.
Take a screenshot to the current directory;
foc@fedora:~$ gnome-screenshot -w root
Taking screenshots on remote server by giving display information;
foc@fedora:~$ gnome-screenshot -w root –display=:0
Check out the manual page in the terminal for more parameters;
foc@pardus:~$ man gnome-screenshot
4. Deepin Screenshot
The Deepin Screenshot application allows to take screenshots from terminal. Default usage example;
foc@pardus:~$ scrot scrot-screenshot.png
After this command, a screenshot will be taken to the directory you are in. You can take a screenshot by selecting the area with the command below;
foc@pardus:~$ scrot -s scrot-screenshot.png
You can delay taking screenshots with the -d parameter;
foc@pardus:~$ scrot -d 200 scrot-screenshot.png
With the -q parameter, it can give quality in the range of 1-100, reduce the size of the image file;
foc@pardus:~$ scrot -q 80 scrot-screenshot.png
For more information about the scrot command, see the manual;
foc@pardus:~$ man scrot
Summary
Although a few applications have been mentioned, of course, screen capture applications are not limited to these.
Some screenshot tools that can be alternatives to the above apps;
- Kazam
- NormCap
- ScreenCloud
- Ksnip
- Flameshot
- Qscreenshot
- Lookit
- Shutter
- ScreenGrab
Related Keywords: linux screenshot, linux how to screenshot, screenshot in linux, screenshot linux, screenshot on linux, linux screen shot, screenshot for linux