Can’t open X display. It *is* running, yeah?
startx ./application — :0 vt8 &
So it was not coming
Then I started with simple
and scrot worked as a charm
I didn’t find a way to specify display and virtual terminal in scrot that is why it didn’t work out in the first try. I didn’t experiment a lot on this.
Another way is by using xwd command
xwd -root -display :0 > good_image.xwd
Then you need to convert xwd image to png or jpeg