0

When I try to put shortcut on "scrot -s" execution, nothing happenes.

When I use just "scrot" screenshot is taken and saved into necessary directory, but when I use "scrot -s" which is supposed to pop up the selection cursor, nothing happens. I tried to use both awful.spawn and awful.spawn.with_shell

awful.key({ modkey, }, "Print",
            function()
                awful.spawn.with_shell("scrot -s")
            end, { description = "take screenshot", group = 
"launcher" })

2 Answers2

2

Bind your hotkey to sleep 0.2 && scrot -s and it will work. The problem seems to be, that the window manager does not release the keyboard fast enough for scrot to be able to grab it (to wait for an abort signal).

Timo L.
  • 36
  • 3
1

Not a solution to your problem but it works if using maim instead of scrot. In addition I'm using xclip to automatically copy the image into my clipboard which is very handy.

awful.key({}, "#107",
  function ()
    awful.util.spawn_with_shell("FILE=" .. os.getenv("HOME") .. "/Media/Screenshots/snapshot-$(date +%Y-%m-%dT%H-%M-%S).png && maim -s --hidecursor $FILE && xclip -selection clipboard $FILE -t image/png")
  end),

ploth
  • 435
  • 8
  • 16