Shortcut to "mate-screenshot -a" not working in Ubuntu MATE 16.04

Solution 1:

There is still an opened issue for that. tl;dr: this is a timing problem with focus. workaround:

bash -c "sleep 0.1 && mate-screenshot -a"

Solution 2:

I reproduced your issue and with help from @Serg and @Seth I figured out how to fix it.

In the shortcut you have set DISPLAY to match your environment. First check the variable:

echo $DISPLAY

and take note of the output. For me it's :0.0

Originally I suggested using this command in the shortcut setting:

bash -c "DISPLAY=:0.0 mate-screenshot -a"

Replacing :0.0 to match the output you got when you checked the variable

But @DavidFoerster pointed out in a comment that the more efficient and proper way is to use

env DISPLAY=:0.0 mate-screenshot -a

Which might make it a touch faster.