aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/lua/screenshot-region.lua
blob: 6ba83bfffc767789287047450e542b7de210a0e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Found on Hyprland discord
-- Possible replacement for screenshot.sh

function screenshot(file_prefix, region)
  local file = "$HOME/Pictures/Screenshots/"
    .. file_prefix
    .. os.date("-%Y-%m-%d_%Hh-%Mm-%Ss_" .. math.random(100000) .. ".png")
  local grim = 'grim -g "' .. region .. '" ' .. file
  local message = " && notify-send Screenshot saved"
  local copy = " && wl-copy < " .. file

  hl.dispatch(hl.dsp.exec_cmd(grim .. message .. copy))
end
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage