Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
How to get a screenshot of only one window from the command line if I have window id?
I want to show a preview screen like this for a specific window with qml and pyqt5. What can I do then?
You can raise the relevant window with the wmctrl command and take its screenshot using the gnome-screenshot command. For example, assuming that the window id is 0x02600010, you can use:
wmctrl -i -a 0x02600010 && gnome-screenshot -w
Required, but never shown