How can I make a window manager take a screenshot at every mouse click? Preferably taking a screenshot first, then pass the mouse click event to the underlying window.
In Gnome, if I press prt sc a screenshot will be taken and saved without question. That's the effect I want for every mouse click. Also, I probably can't use Gnome since it's a virtual X session which Gnome/Unity isn't designed for.
I will accept solutions for using any window manager, be it twm, fvwm or i3 or anything.
I can't provide a direct answer but I solved the problem through my discipline.
Instead of taking a screenshot at every mouse click, do a keyboard combination to run a screenshot capturing software before every mouse click. This requires some discipline from the user, but after working on it for an hour I gained the capacity of habitually do a keyboard combination before clicking.
The virtual session I am running is with this:
The window manager I used was ratpoison (not the best available, just the one I happen to have). The configuration for the shortcut key Ctrl+t F1 is this:
The additional parameter after
date
is needed because sometimes two screenshots have to be captured in one second, requiring finer filenames. The output file needs to be processed withxwdtopnm
later, but the advantage is that the screenshot is taken instantly - other software sometimes captures the screenshot in 0.1 seconds delay, at which time the mouse button might already be clicked.