Solved

Take screen shot of a specific window on linux

Posted on 2010-11-27
4
391 Views
Last Modified: 2012-05-10
I need to take a bunch of screenshots and I'm working on a script to automate the process. I'm currently trying to do this with imagemagick but I'm open to suggestions for other tools.

I want to take a screenshot of a specific window regardless of where it is on the desktop (foreground background) and regardless of which panel it's in.

Using the -window option with imagemagick, it seems to require that the target window has to be in the foreground and it has to be in the same window as the terminal where the script was run.
0
Comment
Question by:opike
  • 2
4 Comments
 
LVL 93

Assisted Solution

by:John Hurst
John Hurst earned 150 total points
ID: 34222153
There are lots of people wishing for SnagIT for Linux, but not yet it appears.

Take a look at this linux link for a possible workaround (kSnapShot).

http://tnerd.com/2008/08/18/ksnapshot-screen-capture-screenshot-for-linux-ubuntu/

... Thinkpads_User
0
 
LVL 9

Accepted Solution

by:
expert_tanmay earned 250 total points
ID: 34222998
Please read about wmctrl http://www.linux.com/archive/feature/122471 you can set a window active with wmctrl e.g. the command wmctrl -a gedit will make the Gedit window active
then use the command gnome-panel-screenshot to take a screenshot of the window.




0
 
LVL 4

Assisted Solution

by:AbhisekSanyal
AbhisekSanyal earned 100 total points
ID: 34226368
Hi,
  As expert_tanmay suggested, use "wmctrl" to activate the window and then as an alternate you can try "xwd" to dump the screen shot.
0
 
LVL 93

Expert Comment

by:John Hurst
ID: 34338373
Thank you. I was pleased to help out. ... Thinkpads_User
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question