naelstrof / maim

maim (make image) takes screenshots of your desktop. It has options to take only a region, and relies on slop to query for regions. maim is supposed to be an improved scrot.
Other
2.13k stars 78 forks source link

No screenshots when invoked via custom keyboard shortcut on Gnome #271

Closed alvv-z closed 1 year ago

alvv-z commented 1 year ago

I have set up custom shortcuts for Print and Ctrl+Print, and after working once, neither takes a screenshot now. It seems like maim exits right after calling, without taking a screenshot. I have tried multiple different invocations, including:

with and without the --nokeyboard option. When executing the commands from a terminal in any directory, they work.

foxpy commented 1 year ago

Try sh -c 'maim --format="png" --hidecursor --quality 10 --select | xclip -selection clipboard -t image/png'

alvv-z commented 1 year ago

Try sh -c 'maim --format="png" --hidecursor --quality 10 --select | xclip -selection clipboard -t image/png'

You're my savior. Thanks a lot. Do you have any ideas as to why the command has to be wrapped like this? It seems odd since it worked once.

alvv-z commented 1 year ago

@foxpy should I close this issue since it is a DE issue, or do you think it's a maim issue?

foxpy commented 1 year ago

@foxpy should I close this issue since it is a DE issue, or do you think it's a maim issue?

I don't think it is an issue at all. I guess previously DE has been passing user-provided snippet to a shell, but now it invokes it as a whole command (hence now you need to pass it wrapped in sh).

So, it is not a problem with your DE or with maim.