aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/lua/screenshot-region.lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/lua/screenshot-region.lua')
-rw-r--r--config/hypr/lua/screenshot-region.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/hypr/lua/screenshot-region.lua b/config/hypr/lua/screenshot-region.lua
new file mode 100644
index 00000000..6ba83bff
--- /dev/null
+++ b/config/hypr/lua/screenshot-region.lua
@@ -0,0 +1,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