commit 93924b75ef111eac75f9586037a8383996983e4b parent 53448c62fcf2387f1c028465fe63552ef1b05530 Author: awy <awy@awy.one> Date: Tue, 30 Dec 2025 21:55:38 +0300 centered Diffstat:
| M | .local/bin/menu/maimpick | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.local/bin/menu/maimpick b/.local/bin/menu/maimpick @@ -9,7 +9,7 @@ output="$(date '+%y%m%d-%H%M-%S').png" wclip_cmd="wl-copy -t image/png" ocr_cmd="wl-copy" -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\na selected area (swappy)\\ncurrent window (swappy)\\nfull screen (swappy)\\ncopy selected image to text" | mew -l 10 -i -p "Screenshot which area?")" in +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\na selected area (swappy)\\ncurrent window (swappy)\\nfull screen (swappy)\\ncopy selected image to text" | mew -c -l 10 -i -p "Screenshot which area?")" in "a selected area") geometry=$(slurp) && sleep 0.2 && grim -g "$geometry" pic-selected-"${output}" && notify-send "📸 maimpick" "Screenshot saved as pic-selected-$output." ;; "current window") geometry=$(swaymsg --raw -t get_tree | jq -r '.. | select(type == "object" and .focused == true) | .rect | "\(.x),\(.y) \(.width)x\(.height)"') @@ -32,5 +32,5 @@ case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area ;; "full screen (swappy)") geometry=$(slurp -o) && sleep 0.2 && grim -g "$geometry" - | swappy -f - ;; "copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && slurp | grim -g - - >"$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" && notify-send "📸 maimpick" "Detected text copied to clipboard.\n$(wl-paste)" ;; -*) notify-send "📸 maimpick" "Wrong option." ;; +*) exit 0 ;; esac