Solved

Take screen shot of a specific window on linux

Posted on 2010-11-27
4
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 95

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 95

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

739 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