How can I create a screenshot of a specific program such as a text editor with a basic hello world printing script in linux. I've looked at Imagemagick but that only seems to do the whole window or coordinates of a window.
I'm either looking for a way to get the coordinates of a program, then pass that to imagemagick or a way to do it simply with a python module.