I am trying to generate a screenshot of a firefox window in my terminal, but I keep getting an error:
root@host [~]# DISPLAY=:1 firefox http://www.cnn.com & sleep 5 && DISPLAY=:1 import -window root -crop 1264x948+0+25 -quality 90 /usr/local/apache/htdocs/screenshot1.jpg && pkill firefox
[1] 30200
import: unable to open X server `:1' @ import.c/ImportImageCommand/364.
Why is this happening? How can I fix it?
Maybe try DISPLAY=:0
, for example?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With