The method of using command to screenshot under Linux graphical interface

Source: Internet
Author: User
Tags linux mint

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.