How to take a screenshot of a window that is not visible in batch mode?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I can get this to work with my dual monitor setup with separate screens on Monitor0 and Monitor1.
From a terminal on Monitor1, I can capture an image from a window displayed on Monitor0 with
If you have only one screen, then the window to be captured and the terminal where the command is issued will both need to be visible on the screen, otherwise the errors reported will occur.
What are the implications of this and what exactly is a sticky window? I don't want this to interfere into my workflow that happens in other windows (which are in other workspaces).
Bummer. Definitely missed it when reading the manpage.
Quote:
Originally Posted by allend
If you have only one screen, then the window to be captured and the terminal where the command is issued will both need to be visible on the screen, otherwise the errors reported will occur.
I do have just one screen indeed. But import from imagemagick is not a mandatory requirement. I'd be happy to use any other CLI tool that will allow me to take screens of windows that are not visible.
You can't take a screenshot of a window that does not exist.
If the window is not visible then there is no window. Maybe you should explain further what you are wanting. To capture the output form a running program/process? Screenshot is just that, a picture of something that is on the screen. Maybe you are wanting something else.
I'm trying to figure out what you are doing. A shot of a minimized window? Or do you have a dual monitor setup with one monitor unplugged? Why isn't the window visible? Or a window that is behind another window? What?
What are the implications of this and what exactly is a sticky window? I don't want this to interfere into my workflow that happens in other windows (which are in other workspaces).
A sticky window is a window visible on all workspaces
You can't take a screenshot of a window that does not exist.
If the window is not visible then there is no window. Maybe you should explain further what you are wanting. To capture the output form a running program/process? Screenshot is just that, a picture of something that is on the screen. Maybe you are wanting something else.
I'm trying to figure out what you are doing. A shot of a minimized window? Or do you have a dual monitor setup with one monitor unplugged? Why isn't the window visible? Or a window that is behind another window? What?
I want to take a screenshot of a window that is identified by an id, but is not visible on screen - it's on another workspace (dwm calls these workspaces tags and I switch between them using Alt+1, Alt+2 and so on).
If you are wanting to capture a window on another work space, then give yourself a pause so you can make it active.
That would defeat the point of what I'm trying to achieve. I can just stick to the workspace where the window in question is, but then
I can't do anything else, because I need to take lots of screens for hours. That's why I want to run that window in the background (another workspace) and I need a way to take screenshots of it.
Quote:
Originally Posted by teckk
Code:
sleep 5 && scrot -u
or
scrot -ud 5
My manpage for scrot has a -d option, but no -u uption. I'm using scrot-0.8
Technically changing window state to sticky does not move it. On the contrary, it's a flag that tells to window manager to let the window stay in place (stick on screen) while other element can move (viewports...)
Maybe dwm doesn't support this feature though (I never used it)
If that is run in a terminal in one work space then you can use keyboard shortcuts to get to another workspace before clicking the mouse to select the window for the snapshot.
I actually usually use it from a script behind a right click menu entry.
PS - The conversion of the window id from hex to decimal does not appear to be necessary for 'import' any more.
Last edited by allend; 04-11-2018 at 05:37 PM.
Reason: Added PS -
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.