From 54a98bfd0c0096cf66b3a2d4ddec41130d8922f6 Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Thu, 15 May 2025 14:15:22 +0200 Subject: [PATCH] add alternative keybindings for screenshot under macbook --- dot_config/hypr/keybindings.conf | 14 ++++++++++---- .../hypr/scripts/executable_screenshot.sh | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 dot_config/hypr/scripts/executable_screenshot.sh diff --git a/dot_config/hypr/keybindings.conf b/dot_config/hypr/keybindings.conf index 7aa68e0..c0e4117 100644 --- a/dot_config/hypr/keybindings.conf +++ b/dot_config/hypr/keybindings.conf @@ -14,7 +14,8 @@ bind = $mainMod, Y, exec, cliphist list | fuzzel --dmenu | { read selection && [ bind = $mainMod+Shift, Y, exec, ~/.config/fuzzel/fuzzel-rbw.sh bind = $mainMod+Shift, M, exec, ~/.config/hypr/scripts/power.sh exit bind = $mainMod+Shift, N, exec, swaync-client -t -sw -bind = $mainMod+Shift, P, exec, ~/.config/hypr/scripts/dotool_wp-paste.sh +bind = $mainMod+Shift, O, exec, ~/.config/hypr/scripts/dotool_wp-paste.sh + # Toggle animations/blur/etc hotkey bind = $mainMod+Shift, G, exec, ~/.config/hypr/scripts/gamemode.sh bind = $mainMod, E, exec, $fileManager @@ -23,9 +24,14 @@ bind = $mainMod, V, togglefloating, bind = $mainMod, D, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle -bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy -bind = $mainMod, Print, exec, grim -g "$(slurp -d)" - | satty -f - -bind = Super, Print, exec, grim -g "$(slurp -o -r -c '##ff0000ff')" -t ppm - | satty --filename - --fullscreen + +# Screenshot +bind = , Print, exec, ~/.config/hypr/scripts/screenshot.sh area +bind = $mainMod, Print, exec, ~/.config/hypr/scripts/screenshot.sh edit +bind = Super, Print, exec, ~/.config/hypr/scripts/screenshot.sh window +bind = $mainMod, P, exec, ~/.config/hypr/scripts/screenshot.sh area +bind = $mainMod+Shift, P, exec, ~/.config/hypr/scripts/screenshot.sh edit +bind = Super, P, exec, ~/.config/hypr/scripts/screenshot.sh window # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l diff --git a/dot_config/hypr/scripts/executable_screenshot.sh b/dot_config/hypr/scripts/executable_screenshot.sh new file mode 100644 index 0000000..92b05a2 --- /dev/null +++ b/dot_config/hypr/scripts/executable_screenshot.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +case $1 in + "area") + grim -g "$(slurp -d)" - | wl-copy + ;; + "edit") + grim -g "$(slurp -d)" - | satty -f - + ;; + "window") + grim -g "$(slurp -o -r -c '##ff0000ff')" -t ppm - | satty --filename - --fullscreen + ;; + *) + echo "Usage: $0 [area|edit|window]" + exit 1 + ;; +esac