Taking screenshots of all your pages in one swoop

After a comment of Thomas Adam and because I felt like learning some basic shellscripting I decided to write a little script that passes all your desks and grabs a shot of each one.

Usage I self explanatory I think even though the filepath has still to be set in the script all other options can be set by using commandline parameters.

This script probably sucks from all sides as my scripting experience doesn’t amount to much (nothing is a good a description as any I guess), so all comments and suggestions are more than welcome :slight_smile:

Oh, before I forget, here it is :slight_smile:

Edit: changed the topic as we are no longer only dealing with zsh

When I initially did this, I took the Fvwm-centric approach:

DestroyFunc ScreenshotAll
AddToFunc ScreenshotAll
+ I PipeRead "ruby -e '0.upto($[desk.pagesy]-1) {|a| \
(0..$[desk.pagesx]-1).each {|b| system(\"scrot \
/tmp/ss/page-#{a}-#{b}.png\"); puts \"GotoPage #{a} #{b}\"}  }'"

At least this way, the number of pages is had from Fvwm, and so it should be pretty much infallable. :stuck_out_tongue: If you have imagemagick installed you can then do something like this:

montage -adjoin -geometry 1280x960 *.png whole_desk.png

Or even add it to the function, but bewarned that it does eat the CPU. You can obviously change the above, to use some $[variable] for the screenshot location path, or what have you, or change the screenshot program, etc.

Here’s a screenshot of what montage produced:
edulinux.homeunix.org/~n6tadam/f … e_desk.png

– Thomas Adam

I don’t stitch everything together just yet, I will eventually though…

So I take it there’s no way to access fvwm’s variables by usin FvwmCommand? I might try to do it in Python then, using the Fvwm python module.