运行 scrot -s 来自 awesome wm
Run scrot -s from awesome wm
当我尝试在 "scrot -s" 执行上设置快捷方式时,没有任何反应。
当我只使用 "scrot" 屏幕截图并保存到必要的目录中,但是当我使用应该弹出选择光标的 "scrot -s" 时,没有任何反应。
我尝试同时使用 awful.spawn 和 awful.spawn.with_shell
awful.key({ modkey, }, "Print",
function()
awful.spawn.with_shell("scrot -s")
end, { description = "take screenshot", group =
"launcher" })
不是您问题的解决方案,但如果使用 maim
而不是 scrot
,它会起作用。此外,我正在使用 xclip
自动将图像复制到我的剪贴板中,这非常方便。
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),
将您的热键绑定到 sleep 0.2 && scrot -s
即可。 The problem seems to be,window 管理器释放键盘的速度不够快,scrot 无法抓住它(等待中止信号)。
当我尝试在 "scrot -s" 执行上设置快捷方式时,没有任何反应。
当我只使用 "scrot" 屏幕截图并保存到必要的目录中,但是当我使用应该弹出选择光标的 "scrot -s" 时,没有任何反应。 我尝试同时使用 awful.spawn 和 awful.spawn.with_shell
awful.key({ modkey, }, "Print",
function()
awful.spawn.with_shell("scrot -s")
end, { description = "take screenshot", group =
"launcher" })
不是您问题的解决方案,但如果使用 maim
而不是 scrot
,它会起作用。此外,我正在使用 xclip
自动将图像复制到我的剪贴板中,这非常方便。
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),
将您的热键绑定到 sleep 0.2 && scrot -s
即可。 The problem seems to be,window 管理器释放键盘的速度不够快,scrot 无法抓住它(等待中止信号)。