From 14f72af3f204b26b5db28e923e0ccccb1b3a8e4f Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 16 Oct 2026 03:31:57 +0100 Subject: [PATCH] Fix: Fall back to grim/slurp for screenshots without hyprshot Super+Print and Super+Shift+Print use hyprshot when installed and grim/slurp otherwise. Add Super+Shift+S (area) and Super+F6 (full screen) for keyboards without a Print key. Co-Authored-By: Claude Opus 5.5 --- dotfiles/.config/hypr/core/hyprmod.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dotfiles/.config/hypr/core/hyprmod.lua b/dotfiles/.config/hypr/core/hyprmod.lua index 29d9f9c..f59b2fd 100644 --- a/dotfiles/.config/hypr/core/hyprmod.lua +++ b/dotfiles/.config/hypr/core/hyprmod.lua @@ -29,6 +29,8 @@ hl.monitor({ output = "DP-2", mode = "1920x1080@165.00Hz", position = "0x0", sca -- (unbind = SUPER SHIFT, Print / unbind = SUPER, up from the source .conf have no Lua equivalent needed — -- we just don't define a conflicting bind elsewhere; SUPER + up -> movefocus u below is otherwise identical -- to the one already in keybinds.lua, kept here too for parity with the original file) -hl.bind("SUPER + Print", hl.dsp.exec_cmd("hyprshot -o " .. os.getenv("HOME") .. "/Pictures/Screenshots-Linux -m region")) +hl.bind("SUPER + Print", hl.dsp.exec_cmd([[sh -c 'if command -v hyprshot >/dev/null; then hyprshot -o "$HOME/Pictures/Screenshots-Linux" -m region; else grim -g "$(slurp)" "$HOME/Pictures/Screenshots-Linux/$(date +%Y-%m-%d_%H-%M-%S).png" && notify-send "Screenshot saved"; fi']])) -- drag an area (hyprshot if installed, else grim/slurp) +hl.bind("SUPER + SHIFT + S", hl.dsp.exec_cmd([[sh -c 'grim -g "$(slurp)" "$HOME/Pictures/Screenshots-Linux/$(date +%Y-%m-%d_%H-%M-%S).png" && notify-send "Screenshot saved"']])) -- region; Surface keyboard has no Print key +hl.bind("SUPER + F6", hl.dsp.exec_cmd([[sh -c 'grim "$HOME/Pictures/Screenshots-Linux/$(date +%Y-%m-%d_%H-%M-%S).png" && notify-send "Screenshot saved"']])) -- full screen hl.bind("SUPER + up", hl.dsp.focus({ direction = "u" })) -hl.bind("SUPER + SHIFT + Print", hl.dsp.exec_cmd("hyprshot -o " .. os.getenv("HOME") .. "/Pictures/Screenshots-Linux -m window")) +hl.bind("SUPER + SHIFT + Print", hl.dsp.exec_cmd([[sh -c 'if command -v hyprshot >/dev/null; then hyprshot -o "$HOME/Pictures/Screenshots-Linux" -m window; else grim "$HOME/Pictures/Screenshots-Linux/$(date +%Y-%m-%d_%H-%M-%S).png" && notify-send "Screenshot saved"; fi']])) -- window (hyprshot) or full screen (fallback)