Linux: How to take screenshot of a particular window? --- wmctrl must be installed

Asked by kirubakaran

Hi,

I Just want to take screenshot of a particular window/process.

I couldn't do it, bcoz i am not sure about the coordinates of a particular window during runtime,

Is there any other way than using the cordinates? Like with the help of process/App name?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

on Windows you can use the App.window() feature to get the region of a Window currently open (not minimized) by supplying a significant part of the window title.

see docs.

come back if not on Windows.

Revision history for this message
kirubakaran (kirubakaran-vnr) said :
#2

I am trying it on Linux.

Do i need to make use of App.focus or SwitchApp()?

I have the window title. Can i do something with the title to take screenShot of a window?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

after having made sure, that wmctrl is installed, bot work:
switchApp("AppName")

or
App.focus("AppName")

if you want to use the app window region:
reg = App("AppName").window()

or
reg = App("AppName").window(n)

if the app has more than one window

Can you help with this problem?

Provide an answer of your own, or ask kirubakaran for more information if necessary.

To post a message you must log in.