mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
196 stars 87 forks source link

Keyboard shortcut for taking a screenshot of a selected region/area #157

Open ghost opened 9 years ago

ghost commented 9 years ago

MATE has implemented the keyboard shortcuts of GNOME for screenshots; like taking a screenshot of the whole desktop with PRINT key, of the active window with Alt+Print. But another one is missing. Shift+Print for taking a screenshot of a selected region/area. When Shift+Print is pressed, the mouse cursor turned into a plus/cross sign like icon; when an area is covered with it or being selected, a screenshot of that selected area/region is taken. It comes handy. It's in GNOME, it should be in MATE too. Waiting for this feature in the next MATE release.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7198918-keyboard-shortcut-for-taking-a-screenshot-of-a-selected-region-area?utm_campaign=plugin&utm_content=tracker%2F841233&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F841233&utm_medium=issues&utm_source=github).
dschwoerer commented 9 years ago

can't you add this as custom shortcut with the command "mate-screenshot -a"?

nickperkins commented 9 years ago

@dschwoerer I've tried this and it ignores the parameter and takes a screenshot of the entire screen.

hk0O7 commented 9 years ago

@nickperkins Me too. And if I try to wrap it in double or single quotes, like this:

"/usr/bin/mate-screenshot --area"

it gives the following error:

There was an error running '/usr/bin/mate-screenshot --area': Failed to execute child process "/usr/bin/mate-screenshot --area" (No such file or directory)

The same happens without the full path, and if I wrap the executable path only it won't take the parameter. The only way I've found to make it work is with a script, and entering its path there.

martin-bts commented 8 years ago

None of this works for me. With the -a parameter, no matter how or where I put it, nothing happens when I use the shortcut. mate-screenshot -a works flawlessly on the console though.

There is a bug report on this https://github.com/mate-desktop/mate-utils/issues/37

edmunddantes7 commented 5 years ago

https://github.com/mate-desktop/marco/issues/157#issuecomment-155733112 +1, same issues here

dschwoerer commented 5 years ago

Try putting

#!/bin/sh
sleep .1
mate-screenshot -a

in a file, make that executable, and then assign that file to the shortcut.

I don't quite understand why the delay is needed, depending on your system, a different delay may be required (or none at all)

seaniedan commented 5 years ago

I can confirm that dschwoerer's fix works. To avoid creating an extra file, I tried adding the commands separately to the Shortcut editor: sleep .1&&mate-screenshot -a ...however this did not work. Create the file as dschwoerer suggests, use chmod +x /the/file/you/created to make it executable, add the new shortcut (System->Hardware->Keyboarard Shortcuts) then click on it and assign Shift and Print as the shortcut.

aparmar commented 4 years ago

Confirming that @dschwoerer solution works. In my cases, I didn't have to add the sleep...so just two lines in the file. Depending on where you put the file, you may need to reference the full file path. In my case, I created it in my home (~) folder, and therefore had to add the full path in the keyboard shortcuts command parameter

hk0O7 commented 4 years ago

Hi.

I've just tried (with dconf-editor) having both commands as /bin/sh's argument on Linux Mint 19.3 (MATE v.1.22.2) and it works without having to rely on a separate file:

/bin/sh -c 'sleep .1;mate-screenshot -a'
jeffmcneill commented 4 years ago

Confirm that @hk0O7 fix worked. Can add this as a custom keyboard shortcut under control center. I do agree that it should be present as another option instead of just window and full screenshots.

oz123 commented 3 years ago

It would be great to have this implemented without a shell wrapper.