Solved

Take screen shot of a specific window on linux

Posted on 2010-11-27
4
386 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 92

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 92

Expert Comment

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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Fine Tune your automatic Updates for Ubuntu / Debian
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.

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now