mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 12:10:42 +00:00
Major rewrite: switching back to Arch from NixOS
This commit is contained in:
parent
df585b737b
commit
254181c0fc
121 changed files with 5433 additions and 2371 deletions
19
home/.local/bin/scripts/gui/ocr
Normal file
19
home/.local/bin/scripts/gui/ocr
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
id=$(tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 6 | head -n 1 || true)
|
||||
echo "Image ID: $id"
|
||||
|
||||
echo "Taking screenshot..."
|
||||
grim -g "$(slurp -w 0)" /tmp/ocr-"$id".png
|
||||
|
||||
echo "Running OCR..."
|
||||
tesseract /tmp/ocr-"$id".png - | wl-copy
|
||||
echo -en "File saved to /tmp/ocr-'$id'.png\n"
|
||||
|
||||
|
||||
echo "Sending notification..."
|
||||
notify-send "OCR " "Text copied!"
|
||||
|
||||
echo "Cleaning up..."
|
||||
rm /tmp/ocr-"$id".png -vf
|
Loading…
Add table
Add a link
Reference in a new issue