In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use gnome-screenshot to take screenshots in linux. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
About Gnome-screenshot
Gnome-screenshot is a GNOME tool that, as its name implies, is a tool for capturing an entire screen, a specific window, or other areas defined by the user. The tool provides several other features, including the ability to beautify the boundaries of captured screenshots.
Gnome-screenshot installation
The gnome-screeshot tool is pre-installed on the Ubuntu system, but if you need to reinstall the software program for some reason, you can install it using the following command:
Sudo apt-get install gnome-screeshot
Once the software is installed, you can start it using the following command:
Gnome-screenshot
Gnome-screenshot usage / characteristics
In this section, we will discuss how to use gnome-screenshot and all the features it provides.
By default, when you use this tool without any command line options, the entire screen is crawled.
Starting Gnome Screenshot
Capture the current active window
If you want, you can use the-w option to limit screenshots of the current active window only.
Gnome-screenshot-w
Capturing current active window
Window frame
By default, the program includes the borders of the windows it captures, although there is an explicit command-line option-b to enable this feature (in case you want to use it somewhere). Here is how to use this program:
Gnome-screenshot-wb
Of course, you need to use both the-w option and the-b option to capture the currently active window (otherwise,-b will have no effect).
More importantly, you can also remove the frame of the window if you want. This can be done using the-B option. Here is an example of how you can use this option:
Gnome-screenshot-wB
The following is a screenshot of the example:
Window border
Add an effect to the window border
With the help of the gnome-screenshot tool, you can also add various effects to the window border. This can be done using the-- border-effect option.
You can add any of the effects provided by the program, such as the shadow effect (adding shadows to the window), the bordor effect (adding a rectangular area around the screenshot), and the vintage effect (diluting the screenshot slightly, coloring and adding a rectangular area around it).
Gnome-screenshot-- border-effect= [EFFECT]
For example, run the following command to add a shadow effect:
Gnome-screenshot-border-effect=shadow
The following is a sample snapshot of the shadow effect:
Adding effects to window borders
Please note that the above screenshots are mainly concentrated in a corner of the terminal so that you can see the shadow effect clearly.
A screenshot of a specific area
You can also use the gnome-screenshot program to take screenshots of a specific area of your computer screen as you need it. This can be done by using the-an option.
Gnome-screenshot-a
When the above command is run, your mouse pointer will change to the'+ 'symbol. In this mode, you can hold down the left mouse button and move the mouse to take a screenshot of a particular area.
This is an example screenshot that clips a small part of my terminal window.
Example screenshot wherein I cropped a small area of my terminal window
Include the mouse pointer in the screenshot
By default, every time you take a screenshot using this tool, the screenshot does not include a mouse pointer. However, this program allows you to include pointers, which you can do with the-p command line option.
Gnome-screenshot-p
This is an example screenshot:
Include mouse pointer in snapshot
Delayed screenshot
You can also introduce time delay when taking screenshots. To do this, you don't need to assign a value in seconds to the-- delay option.
Gnome-screenshot-delay= [SECONDS]
For example:
Gnome-screenshot-delay=5
The example screenshot is as follows:
Delay in taking screenshots
Run the tool in interactive mode
The tool also allows you to access all its functions using a separate-I option. Using this command line option, users can use one or more features of the tool when running the command.
Gnome-screenshot-I
The example screenshot is as follows:
Run the tool in interactive mode
As you can see from the screenshot above, the-I option provides access to many functions, such as capturing the entire screen, capturing the current window, selecting an area for screenshot, delay options and special effects options are all in interactive mode.
Save your screenshot directly
If you want, you can save the captured image directly from the terminal to your current working directory, which means that after the program runs, it does not require you to enter a file name for the captured image. This function can be obtained using the-- file command-line option, and obviously, you need to pass it a file name.
Gnome-screenshot-file= [FILENAME]
For example:
Gnome-screenshot-file=ashish
The example screenshot is as follows:
Directly save your screenshot
Copy to clipboard
Gnome-screenshot also allows you to copy your screenshots to the clipboard. This can be done by using the-c command line option.
Gnome-screenshot-c
Copy to clipboard
In this mode, for example, you can paste the copied image directly into any of your image editors (such as GIMP).
Screenshots in the case of multiple monitors
If you have multiple monitors connected to your system and you want to take a screenshot of one, you can use the-- then command line option. This option needs to be given the value of the display device ID (the ID of the monitor that needs to be captured).
Gnome-screenshot-- display= [DISPLAY]
For example:
Gnome-screenshot-display=VGA-0
In the above example, VAG-0 is the ID of the monitor I'm trying to take a screenshot of. To find the ID of the monitor you want to take screenshots of, you can use the following command:
Xrandr-query
To make you understand, in my example, this command produces the following output:
$xrandr-- query Screen 0: minimum 320 x 200, current 1366x768, maximum 8192 x 8192 VGA-0 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm 1366x768 59.8 344mm + 1024x768 75.1 75.0 60.0 832x624 74.6 800x600 75.0 60.3 56.2 640x480 75.0 60.0 720x400 70.1 HDMI-0 disconnected (normal left inverted right x axis y axis)
Automate the screenshot process
As we discussed earlier, the-a command line option can help us take screenshots of a particular area of the screen. However, we need to manually select this area with the mouse. You can automate this process using gnome-screenshot if you want, but in that case you will need to use a tool called xdotol, which can mimic keystrokes or even mouse clicks.
For example:
(gnome-screenshot-a &); sleep 0.1 & & xdotool mousemove 100100 mousedown 1 mousemove 400400 mouseup 1
The mousemove subcommand automatically positions the mouse pointer to the explicit X and Y coordinates (100,100 in the above example). The mousedown subcommand triggers an event that performs the same action as the click (we used parameter 1 because we want to left-click), while the mouseup subcommand triggers an event that performs the user's task of releasing the mouse button.
So all in all, the xdotool command shown above does what would have been necessary to manually take a screenshot of the same area using the mouse. In particular, the command positions the mouse pointer to the position on the screen with coordinates 100100 and selects a closed area until the pointer reaches the position with coordinates 400400 on the screen. The selected area is then captured by gnome-screenshot.
This is a screenshot of the above command:
Screenshot of the above command
This is the result of the output:
Screenshot output
For more information about xdotool, please come here.
Get help
If you have questions or you are facing a problem related to one of the options on the command line, you can use-- help, -? Or-h option to get the relevant information.
Gnome-screenshot-h above is all the content of the article "how to use gnome-screenshot to take screenshots in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.