I often need to take screenshots of windows that are larger than the currently shown desktop. I'm on Ubuntu 11.04,
gnome-about says Version: 2.32.1;
compiz --version says Compiz 0.9.4.0 -- and I have four virtual desktops/workspaces, which are arranged as such:
The above images were obtained by moving into each separate workspace, and taking a screenshot via PrintScreen key - that is to say,
gnome-screenshot. (I am aware that there are better ways of obtaining
firefox shots, like the "Page Saver" addon - the above is taken simply as an example of a generic oversized window).
EDIT: I'm apparently using the wrong nomenclature here (found via xorg - Get current Virtual Desktop - number/name/tag/id? - Unix and Linux) - it turns out, in the above example, I still have only one workspace; what is changed, instead, is the viewport - this is what
wmctrl -d shows on each of the "virtual desktops":
$ wmctrl -d 0 * DG: 2048x1200 VP: 0,0 WA: 0,1 1024x598 Workspace 1 $ wmctrl -d 0 * DG: 2048x1200 VP: 0,600 WA: 0,1 1024x598 Workspace 1 $ wmctrl -d 0 * DG: 2048x1200 VP: 1024,0 WA: 0,1 1024x598 Workspace 1 $ wmctrl -d 0 * DG: 2048x1200 VP: 1024,600 WA: 0,1 1024x598 Workspace 1
so to switch between "virtual desktops" from the command line, I should in fact change the "viewport", as in:
wmctrl -o 1024,0
Obviously, moving to each virtual desktop, taking a screenshot and stitching them together - and finally cutting the application window - is a bit tedious, so I was wandering if there was a tool (preferably command line) that would allow me to pick a window that is larger than the current desktop, and takes a screenshot of its entire contents, in one go. There could be two scenarios here as well:
- A larger-than-desktop window is moved so it takes up space on several virtual desktops (like the images above show)
- A larger-than-desktop window is moved outside of the total size of all virtual desktops (from the perspective of top-left desktop in composition above, imagine moving the application window towards the top-left, and outside of desktop area - as opposed to it being moved bottom right as shown above)
The first case is possible, if not in any other way, then manually (as I did it above) -- and for the second case, I guess it should be possible for an application to either "move" the window briefly to the total all-desktops area - or create a "virtual" graphics context not shown on screen, and render the window there (although, I don't know enough details to know for sure).
I have tried the following tools so far:
and they will all capture just a "corner" of the entire application window, which is shown on the current desktop (in a situation as shown above). When trying to capture "root" or "full-screen", all of these capture just the currently rendered desktop (not the total area of all virtual desktops).
I also tried
shutter (0.87.2 Rev.1071), and while I've found information that from version 0.86.4 onwards, "you can capture all virtual desktops now. Shutter will go through all of them, take a picture of every one and compose them into a one large screenshot" - I did give a try clicking on "Capture all Workspaces" - but it only takes a shot of the current workspace/desktop; window captures are likewise cut at the limits of current desktop (or fail with "Error while taking the screenshot: Maybe mouse pointer could not be grabbed or the selected area is invalid." if the window fully sits in a virtual desktop other than the current one).
Then I read that there is a screenshot plugin for
compiz - and since here
compiz manages the virtual desktops, I thought it could handle the total area - but there are no settings there (in CompizConfig settings manager), but: "Enable plugin", an output directory, and a button to enable and set hotkeys for "Initiate rectangle screenshot" -- and since apparently only thing you can do is drag with the mouse to specify a rectangular area, I doubt that plugin would help capturing the total area in one go.
Thus, I'd like to ask for some suggestions about tools, that can:
- Capture the total area (all workspaces/virtual desktops) in one go; or
- Capture the total area of the selected window, even if it is pushed outside of the currently rendered desktop (also in one go)
I would prefer something that deals with this stuff in memory - I myself could come up with something worse: such as a
bash script that sends keystrokes to change desktops (or just via
wmctrl), and takes individual screenshots there -- but that would be a pain to use, especially since I'd be visually exposed to the "desktop switching" while the screenshot is being captures... If not any complete programs, suggestions for C/Perl/Python APIs that can access bitmap data on all/any virtual desktops would be great too.