diff --git a/dots/.config/hypr/hyprland/keybinds.conf b/dots/.config/hypr/hyprland/keybinds.conf index 5e6ff1e80..46d542399 100644 --- a/dots/.config/hypr/hyprland/keybinds.conf +++ b/dots/.config/hypr/hyprland/keybinds.conf @@ -61,8 +61,9 @@ bindd = Super, Period, Copy an emoji, exec, qs -c $qsConfig ipc call TEST_ALIVE bind = Super+Shift, S, global, quickshell:regionScreenshot # Screen snip bind = Super+Shift, S, exec, qs -c $qsConfig ipc call TEST_ALIVE || pidof slurp || hyprshot --freeze --clipboard-only --mode region --silent # [hidden] Screen snip (fallback) bind = Super+Shift, A, global, quickshell:regionSearch # Google Lens +bind = Super+Shift, A, exec, qs -c $qsConfig ipc call TEST_ALIVE || pidof slurp || ~/.config/hypr/hyprland/scripts/snip_to_search.sh # [hidden] Google Lens (fallback) # OCR -bindd = Super+Shift, T, Character recognition,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract "tmp.png" - | wl-copy && rm "tmp.png" # [hidden] +bind = Super+Shift, T,exec,grim -g "$(slurp $SLURP_ARGS)" "/tmp/ocr_image.png" && tesseract "/tmp/ocr_image.png" - | wl-copy && rm "/tmp/ocr_image.png" # [hidden] # Color picker bindd = Super+Shift, C, Color picker, exec, hyprpicker -a # Pick color (Hex) >> clipboard # Fullscreen screenshot diff --git a/dots/.config/hypr/hyprland/scripts/snip_to_search.sh b/dots/.config/hypr/hyprland/scripts/snip_to_search.sh new file mode 100755 index 000000000..60a68fe94 --- /dev/null +++ b/dots/.config/hypr/hyprland/scripts/snip_to_search.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +grim -g "$(slurp)" /tmp/image.png +imageLink=$(curl -sF files[]=@/tmp/image.png 'https://uguu.se/upload' | jq -r '.files[0].url') +xdg-open "https://lens.google.com/uploadbyurl?url=${imageLink}" +rm /tmp/image.png