feat: use grim, slurp and satty for screenshots

This commit is contained in:
2026-08-23 08:35:34 +02:00
parent 9387be3be8
commit 4cfee8e16b
7 changed files with 24 additions and 21 deletions
+5 -6
View File
@@ -3,13 +3,12 @@ local function exit_submap()
end
-- TODO: Update this for laptop
hl.bind("code:232", hl.dsp.exec_cmd("brightnessctl -S"), { description = "Doesn't do anything yet" })
-- bind = ,code:232, exec, light -U 5 && notify-send 'Display brightness decreased by 5%'
-- bind = ,code:233, exec, light -A 5 && notify-send 'Display brightness increased by 5%'
hl.bind("code:232", hl.dsp.exec_cmd("brightnessctl set 5%-"), { description = "Decrease screen brightness" })
hl.bind("code:233", hl.dsp.exec_cmd("brightnessctl set +5%"), { description = "Increase screen brightness" })
hl.bind("code:123", hl.dsp.exec_cmd("pamixer -i 5"), { description = "Increase volume by 5%" })
hl.bind("code:122", hl.dsp.exec_cmd("pamixer -d 5"), { description = "Decrease volume by 5%" })
hl.bind("code:121", hl.dsp.exec_cmd("pamixer t"), { description = "Open mixer" })
hl.bind("code:123", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), { description = "Increase volume by 5%" })
hl.bind("code:122", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { description = "Decrease volume by 5%" })
hl.bind("code:121", hl.dsp.exec_cmd("hyprpwcenter"), { description = "Open mixer" })
hl.define_submap("device", function()
hl.bind("m", function()
-2
View File
@@ -5,8 +5,6 @@ end
hl.bind("SUPER + SHIFT + H", hl.dsp.group.prev(), { description = "Go to previous group member" })
hl.bind("SUPER + SHIFT + L", hl.dsp.group.next(), { description = "Go to next group member" })
-- TODO: Improve mapping (also global mapping, for moving between els if to use regularly)
-- Improve colours
hl.define_submap("groups", function()
hl.bind("c", function()
hl.dispatch(hl.dsp.group.toggle())
+15 -7
View File
@@ -4,32 +4,40 @@ end
hl.define_submap("screenshot", function()
hl.bind("y", function()
hl.dispatch(hl.dsp.exec_cmd("dms screenshot --no-file"))
hl.dispatch(hl.dsp.exec_cmd('grim -g "$(slurp -d)" - | wl-copy'))
exit_submap()
end, { description = "Take sceenshot of are and Yank" })
end, { description = "Take sceenshot of area and Yank" })
hl.bind("c", function()
hl.dispatch(hl.dsp.exec_cmd("dms screenshot"))
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("dms screenshot --no-clipboard"))
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("dms screenshot full --no-file"))
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("dms screenshot full"))
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("dms screenshot full --no-clipboard"))
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" })