2021-08-08 13:18:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euf -o pipefail
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
desktop)
|
|
|
|
target=~/.config/i3/screenshots/$(date -Iseconds).jpg
|
2021-09-05 08:11:12 +02:00
|
|
|
maim -u -m 9 $target
|
2021-08-08 13:18:49 +02:00
|
|
|
notify-send -i camera-photo "Desktop screenshot" "Saved in ${target##*/}"
|
|
|
|
echo -n $target | xclip -selection clipboard
|
|
|
|
;;
|
|
|
|
window)
|
2022-04-21 12:52:33 +02:00
|
|
|
maim -u -s -b 5 -l -c 0.3,0.4,0.6,0.4 -d 0.1 \
|
2021-08-08 13:18:49 +02:00
|
|
|
| xclip -selection clipboard -t image/png
|
|
|
|
notify-send -i camera-photo "Screenshot" "Saved to clipboard"
|
|
|
|
;;
|
2022-11-22 20:01:22 +01:00
|
|
|
ocr)
|
|
|
|
maim -u -s -b 5 -l -c 0.3,0.4,0.6,0.4 -d 0.1 \
|
|
|
|
| tesseract --dpi 96 -l eng - - \
|
|
|
|
| xclip -selection clipboard -t text/plain
|
|
|
|
notify-send -i ebook-reader "OCR" "Saved to clipboard"
|
|
|
|
;;
|
2021-08-08 13:18:49 +02:00
|
|
|
esac
|