Solved

Take screen shot of a specific window on linux

Posted on 2010-11-27
4
383 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 90

Assisted Solution

by:John Hurst
John Hurst earned 150 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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 90

Expert Comment

by:John Hurst
Comment Utility
Thank you. I was pleased to help out. ... Thinkpads_User
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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