Files

48 lines
1.6 KiB
Lua

local function exit_submap()
hl.dispatch(hl.dsp.submap("reset"))
end
hl.define_submap("screenshot", function()
hl.bind("y", function()
hl.dispatch(hl.dsp.exec_cmd('grim -g "$(slurp -d)" - | wl-copy'))
exit_submap()
end, { description = "Take sceenshot of area and Yank" })
hl.bind("c", function()
hl.dispatch(
hl.dsp.exec_cmd(
'grim -g "$(slurp -d)" - | satty -f - --copy-command wl-copy -o "~/Pictures/Screenshots/%Y-%m-%dT%H:%M:%SZ%z.png"'
)
)
exit_submap()
end, { description = "Take screenshot of area, yank and save" })
hl.bind("s", function()
hl.dispatch(hl.dsp.exec_cmd("grim -g '$(slurp -d)' $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%dT%H:%M:%SZ%z.png')"))
exit_submap()
end, { description = "Take screenshot of area and Save" })
hl.bind("SHIFT + y", function()
hl.dispatch(hl.dsp.exec_cmd("grim - | wl-copy"))
exit_submap()
end, { description = "Take screenshot and Yank" })
hl.bind("SHIFT + c", function()
hl.dispatch(
hl.dsp.exec_cmd(
'grim - | satty -f - --copy-command wl-copy -o "~/Pictures/Screenshots/%Y-%m-%dT%H:%M:%SZ%z.png"'
)
)
exit_submap()
end, { description = "Take sceenshot, yank and save" })
hl.bind("SHIFT + s", function()
hl.dispatch(hl.dsp.exec_cmd("grim $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%dT%H:%M:%SZ%z.png')"))
exit_submap()
end, { description = "Take screenshot and Save" })
hl.bind("Escape", function()
exit_submap()
end)
end)