Solved

Take screen shot of a specific window on linux

Posted on 2010-11-27
4
392 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 94

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 94

Expert Comment

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

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

756 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