简体   繁体   中英

Run scrot -s from awesome wm

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" })

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),

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM