How to take a screenshot at every mouse click












0















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.










share|improve this question




















  • 2





    gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

    – DK Bose
    Jan 5 at 12:31











  • @DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

    – Peer Gynt
    Jan 6 at 0:54











  • Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

    – sudodus
    Jan 6 at 0:59













  • In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

    – Peer Gynt
    Jan 6 at 0:59






  • 1





    @sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

    – Peer Gynt
    Jan 7 at 1:13
















0















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.










share|improve this question




















  • 2





    gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

    – DK Bose
    Jan 5 at 12:31











  • @DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

    – Peer Gynt
    Jan 6 at 0:54











  • Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

    – sudodus
    Jan 6 at 0:59













  • In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

    – Peer Gynt
    Jan 6 at 0:59






  • 1





    @sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

    – Peer Gynt
    Jan 7 at 1:13














0












0








0








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.










share|improve this question
















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.







window-manager






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 6 at 1:00







Peer Gynt

















asked Jan 5 at 11:50









Peer GyntPeer Gynt

7731815




7731815








  • 2





    gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

    – DK Bose
    Jan 5 at 12:31











  • @DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

    – Peer Gynt
    Jan 6 at 0:54











  • Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

    – sudodus
    Jan 6 at 0:59













  • In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

    – Peer Gynt
    Jan 6 at 0:59






  • 1





    @sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

    – Peer Gynt
    Jan 7 at 1:13














  • 2





    gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

    – DK Bose
    Jan 5 at 12:31











  • @DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

    – Peer Gynt
    Jan 6 at 0:54











  • Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

    – sudodus
    Jan 6 at 0:59













  • In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

    – Peer Gynt
    Jan 6 at 0:59






  • 1





    @sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

    – Peer Gynt
    Jan 7 at 1:13








2




2





gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

– DK Bose
Jan 5 at 12:31





gnome-screenshot should work irrespective of the window manager. At least it does with Openbox.

– DK Bose
Jan 5 at 12:31













@DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

– Peer Gynt
Jan 6 at 0:54





@DKBose do you mean that in Openbox if you press <kbd>prt sc</kbd> it will run gnome-screenshot? Is it by default? If so I can use it to produce a serial of snapshots by pressing that key every time before I click a mouse button.

– Peer Gynt
Jan 6 at 0:54













Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

– sudodus
Jan 6 at 0:59







Lubuntu uses scrot in a similar way and it uses the Openbox window manager, Anyway, it will also take a screenshot that way by pressing the PrintScreen key and store it in a file with a time string in the name. This file will go to your home directory in Lubuntu (while the screenshot goes to ~/Pictures in standard Ubuntu). By the way, Ubuntu 18.04.x uses gnome, so it should work for you too.

– sudodus
Jan 6 at 0:59















In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

– Peer Gynt
Jan 6 at 0:59





In Windows, this can be done with Snappy. I imagine in Linux you probably can configure a window-manager to do that, not having to rely on some desktop software.

– Peer Gynt
Jan 6 at 0:59




1




1





@sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

– Peer Gynt
Jan 7 at 1:13





@sudodus the virtual session is a 3000x40000 pixel huge window - it was virtual preciously because the current monitor can't get a hold of it. So capturing the viewport isn't useful. Sorry I didn't give the entire scenario to prevent TLDR.

– Peer Gynt
Jan 7 at 1:13










1 Answer
1






active

oldest

votes


















1














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:



$ vnc4server # Google search for how to connect to the virtual session.


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:



$ cat .ratpoisonrc 
bind F1 exec xwd -root -out /tmp/"`date +'%T.%3N'`"


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 with xwdtopnm 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.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1107154%2fhow-to-take-a-screenshot-at-every-mouse-click%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    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:



    $ vnc4server # Google search for how to connect to the virtual session.


    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:



    $ cat .ratpoisonrc 
    bind F1 exec xwd -root -out /tmp/"`date +'%T.%3N'`"


    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 with xwdtopnm 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.






    share|improve this answer




























      1














      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:



      $ vnc4server # Google search for how to connect to the virtual session.


      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:



      $ cat .ratpoisonrc 
      bind F1 exec xwd -root -out /tmp/"`date +'%T.%3N'`"


      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 with xwdtopnm 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.






      share|improve this answer


























        1












        1








        1







        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:



        $ vnc4server # Google search for how to connect to the virtual session.


        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:



        $ cat .ratpoisonrc 
        bind F1 exec xwd -root -out /tmp/"`date +'%T.%3N'`"


        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 with xwdtopnm 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.






        share|improve this answer













        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:



        $ vnc4server # Google search for how to connect to the virtual session.


        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:



        $ cat .ratpoisonrc 
        bind F1 exec xwd -root -out /tmp/"`date +'%T.%3N'`"


        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 with xwdtopnm 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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 7 at 1:12









        Peer GyntPeer Gynt

        7731815




        7731815






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1107154%2fhow-to-take-a-screenshot-at-every-mouse-click%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ellipse (mathématiques)

            Quarter-circle Tiles

            Mont Emei