Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash imagemagick import screen capture with minimized and maximized windows

I want to do a simple full screen capture from a bash script in ubuntu. This:

import -window root screen.png

from imagemagick worked fine, untill--- I switched to a laptop with an external display connected. Now the captured image is not what is shown on the screen, but instead it shows the different windows. Is there a way to control this behavior of import, or do I need another tool?

Edit:

It is very important for me that no mouse-click is needed, as the script is run without human interaction.

Edit:

The real problem is not what I original thought, but it is an error of import - It can not handle maximized or minimized windows correctly.

like image 519
hpekristiansen Avatar asked Oct 17 '25 09:10

hpekristiansen


2 Answers

Specifying display and window will remove the need for mouse click:

import -display :0.1 -window root -colorspace RGB -quality 80 screendump.jpg

like image 165
bos Avatar answered Oct 19 '25 07:10

bos


Tell it to use a specific screen.

import -display :0.1 ...
like image 30
Ignacio Vazquez-Abrams Avatar answered Oct 19 '25 09:10

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!