Capture Screen, Window or User Defined Area Using gnome-screenshot Utility

By | 22/07/2013

Many of us use ‘Prnt Scrn’ key to capture snapshots for our day-to-day work. On Ubuntu there is a bug that disables this key when a drop down menu of a program is open. I too faced the same problem and looked around for a tool that might do the required job. After a bit of googling, I found that there exists a command line utility gnome-screenshot (for gnome environments) that can do most of the screen-shot capturing work smartly.

In this article, we will discuss how to use gnome-screenshot utility along with its options through some examples.

 

gnome-screenshot Examples

We will discuss 6 examples of this utility.

1. Simply capture whole screen

In it’s very basic form, gnome-screenshot can be used to capture complete screen.

All you need to run is :

$ gnome-screenshot

Here is an example :

gnome_cmplete_screen

(Click to enlarge)

You can see that the complete screen was captured.

2. Capture active shell window through -w option

Unlike the capture shown in example 1, if it is desired to capture only shell window then -w option can be used.

All you need to run is :

$gnome-screenshot -w

Here is an example screen-shot using -w option :

gnome_active_window

(Click to enlarge)

So you can see that only the shell window was captured and not the complete screen.

3. Capture user defined area using -a option

Most of the times it is required to capture just some area and not a window or complete screen. In this case, -a option can be used.

All you need to do is:

$ gnome-screenshot -a

This should change cursor into area selecting pointer. You can use left mouse click to select an area. As soon as you leave the mouse press, snapshot will be taken.

Here is an example snapshot that I took using this option :

gnome_Area

So you can see that a small area was captured.

4. Exclude window border using -B option

In example 2, you can see that window border was included in snapshot. You have the choice to exclude window borders in snapshots by using -B option.

All you need to do is :

$ gnome-screenshot -w -B

Here is an example screen-shot where border is not included :

gnome_no_border

(Click to enlarge)

So you can see that window border was removed from the snapshot.

5. Introduce delay before snapshot using -d option

Using -w option (example 2) you can capture active shell window but it’s not always a shell window that you might want to capture. Suppose you want to capture web browser window. -w option won’t let you do this because it captures current window instantaneously. So, you need to introduce some delay so that you get some time to change active window. The option -d (followed by a number indicating delay in seconds) will let you do exactly the same.

All you need to run is :

$ gnome-screenshot -d 5

Once you run the above command, you get 5 seconds to change the active window. After 5 seconds, snapshot will be captured automatically.

Here is a snapshot that I captured this way :

gnome_delay

(Click to enlarge)

So, once I executed above command, I used alt+tab to switch to my browser window and then after 5 seconds were over, snapshot was taken automatically.

6. Add effects to snapshot using -e option

gnome-screenshot utility has the capability to add some effects to the captured snapshot. Available effects are border and shadow.

To add an effect (for example border), all you need to do is :

$ gnome-screenshot -wB -e border

NOTE – I have used -w to capture active window, -B to exclude borders

Here is a snap-shot with border effect:

gnome_affect_border

(Click to enlarge)

So you can see that a black border was added as an effect to the snapshot. Similarly we can apply shadow effect. By default the effect is none.

NOTEAll the options supported by gnome-screenshot can also be given from a GUI mode. This is called as interactive mode and this mode can be activated using -i option.

NOTE – Interested in other screen capturing utilities? Read our article on scrot command.

One thought on “Capture Screen, Window or User Defined Area Using gnome-screenshot Utility

  1. Oleg

    scrot is better (and faster).
    HotShots (hotshots.sf.net, ppa:dhor/myway) is excellent.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *