Previous screenshots in Linux were directly pressed on the Print SCREEN key or ALT + print screens.
But the print screen is the entire display, and ALT + print is the current window.
What do you want to intercept an area of the screen?
The answer is the import command, enter:
The code is as follows:
$ import Ddd.jpg
Then the mouse will become "+", just like the QQ screenshot tool, a drag on the OK, convenient.
Login Screen screenshot
In daily use, our screenshots are done after logging into the system, such as capturing a window, capturing a specified area, or capturing an entire Web page. To give a screenshot of the login screen, that is the operation before login, it is a bit complicated.
Capture a screenshot of the login interface with these commands under root permissions:
The code is as follows:
CHVT 8
Sleep 5
display=:0.0 xauthority=/var/lib/mdm/:0. Xauth xwd-root >/tmp/shot.xwd
Convert/tmp/shot.xwd/tmp/ss.png
The key point of these commands is the xauthority=/var/lib/mdm/of the third line. For different distributions, the default is to use a different login manager, for example, Ubuntu uses Lightdm,kubuntu with Kdm,linux Mint with MDM, and a release version of Gnome for the desktop environment is GDM.
Different login manager, the corresponding xauthority also is not the same. So the information found on the Internet, there are some xauthority=/var/run/lightdm/root/, some xauthority=/var/lib/gdm/. So the question is, how do we determine which login manager is used for the current system?
Of course not to shoot the head, to be reasoned. At first I habitually thought I was using the DM is KDM, the result fell into the pit.
In fact, it is very simple, only to the name of the process that contains DM to take a look at, you can determine how to write the order.