3

so I'm been trying to simulate Xubuntu to work similarly to the stuff I often do on my MacBookPro. One of the things I often do is to create a screenshot of a region and on xUbuntu, this is done via:

xfce4-screenshooter -r

My question is: if I pressed the shortcut combination by mistake, how do I exit without taking a pic? On the Mac, this can be done via the escape key or perhaps right-clicking using the mouse (not sure now. but can confirm in a bit).

I've searched the net before asking but nothing useful comes up.

Thanks a lot.

edit: Pressing the "escape" key works the first time. but if I press the shortcut again, "escape" key doesn't work anymore.

3
  • 2
    Pressing Esc cancels the screenshot just fine for me.
    – muru
    Mar 12, 2016 at 10:39
  • I just tried it again. seems to work the first time. but if I press the shortcut again, "escape" key doesn't work anymore.
    – mrjayviper
    Mar 12, 2016 at 10:51
  • 1
    I can reproduce this issue sometimes, when running xfce4-screenshooter -r in Xfce 4.10 by using keyboard shortcuts. This issue doesn't occur if the command is run from Terminal or application launcher.
    – user37165
    Mar 13, 2016 at 12:58

2 Answers 2

4

Use timeout command to run the screenshot tool with a time limit.

Add a new application shortcut with the following command.

timeout 15 bash -c 'xfce4-screenshooter -r -s $HOME'

Then, press any keyboard keys of choice for the command shortcut. I had used Shift+Print keys in my testing. Now press again the keys to invoke the command.

Why those options

-s PATH is to specify directory at PATH where the screenshot will be saved. This option will skip the dialog to select action i.e. save, copy to clipboard that is shown before "Save As" dialog. This will reduce user interaction by several seconds.

bash -c '... $HOME' is to specify the environmental variable of Home directory of current user, using bash shell. This is convenient, rather than using direct path as /home/USERNAME.

Wait or kill

When timeout has reached the duration, the specified command i.e. Screenshooter will be terminated, regardless of screenshot has been taken and saved or otherwise. The command doesn't require a separate shortcut to exit the application. Wait for specified duration to exit on its own.

If the specified duration is quite long to wait, user can either:

  • Change the timeout duration from 15 to smaller value in seconds

  • Exit immediately by using the shortcut keys for killall xfce4-screenshooter as suggested by @linuxode

The latter seems to be an easier workaround, rather than changing the timeout duration that depends on time taken by user to select a region and saving the screenshot with different name, if any. This is why I had suggested 15 seconds and not lesser than that.

Even better, set optimal duration (neither too short nor too long for user to wait) and use both of the workarounds that will allow user to either "wait or kill", to exit Screenshooter in Xfce.

Disclaimer: This answer suggests a workaround, not a definite solution. The best answer would be to use Esc key that is supposed to work properly with Screenshooter in Xfce. I'm unsure if the said issue is still occurring in Xfce newer than 4.10 or else.

3

The command to do this (or for any unresponsive app) is killall <application name> So, in your case it will be killall xfce4-screenshooter How do you do this?

Set up a keyboard shortcut for this command. Whenever you accidentally press the keyboard combination for xfce4-screenshooter -r, simply press Escape or the shortcut you created for killall xfce4-screenshooter.

Found this here (Look at the second comment).

1
  • +1 because this worked for me recently, using shortcut for killall xfce4-screenshooter when the application failed to exit with Esc key.
    – user37165
    May 15, 2016 at 9:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .